From 884e827fa4847e93bdc44c1fa3808318860fd71c Mon Sep 17 00:00:00 2001 From: win32ss Date: Sun, 15 Dec 2024 22:04:53 -0500 Subject: [PATCH] (#1057) GCM connections blocked --- components/gcm_driver/gcm_client_impl.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gcm_client_impl.cc index 45421d38fe1490..5e92bedd9ff2fb 100644 --- a/components/gcm_driver/gcm_client_impl.cc +++ b/components/gcm_driver/gcm_client_impl.cc @@ -10,6 +10,7 @@ #include #include +#include "base/command_line.h" #include "base/files/file_path.h" #include "base/functional/bind.h" #include "base/location.h" @@ -425,7 +426,8 @@ void GCMClientImpl::OnLoadCompleted( void GCMClientImpl::StartGCM() { DCHECK(io_task_runner_->RunsTasksInCurrentSequence()); - + if (base::CommandLine::ForCurrentProcess()->HasSwitch("ungoogled-supermium")) + return; // Taking over the value of account_mappings before passing the ownership of // load result to InitializeMCSClient. std::vector account_mappings; @@ -449,6 +451,8 @@ void GCMClientImpl::StartGCM() { void GCMClientImpl::InitializeMCSClient() { DCHECK(network_connection_tracker_); + if (base::CommandLine::ForCurrentProcess()->HasSwitch("ungoogled-supermium")) + return; std::vector endpoints; endpoints.push_back(gservices_settings_.GetMCSMainEndpoint()); GURL fallback_endpoint = gservices_settings_.GetMCSFallbackEndpoint(); @@ -653,7 +657,8 @@ void GCMClientImpl::RemoveHeartbeatInterval(const std::string& scope) { void GCMClientImpl::StartCheckin() { DCHECK(io_task_runner_->RunsTasksInCurrentSequence()); - + if (base::CommandLine::ForCurrentProcess()->HasSwitch("ungoogled-supermium")) + return; // Make sure no checkin is in progress. if (checkin_request_) return; @@ -732,6 +737,9 @@ void GCMClientImpl::SetGServicesSettingsCallback(bool success) { void GCMClientImpl::SchedulePeriodicCheckin() { DCHECK(io_task_runner_->RunsTasksInCurrentSequence()); + if (base::CommandLine::ForCurrentProcess()->HasSwitch("ungoogled-supermium")) + return; + // Make sure no checkin is in progress. if (checkin_request_.get() || !device_checkin_info_.accounts_set) return;