Skip to content

Commit

Permalink
(#1057) GCM connections blocked
Browse files Browse the repository at this point in the history
  • Loading branch information
win32ss committed Dec 16, 2024
1 parent 4979b9d commit 884e827
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions components/gcm_driver/gcm_client_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <string_view>
#include <utility>

#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/location.h"
Expand Down Expand Up @@ -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<AccountMapping> account_mappings;
Expand All @@ -449,6 +451,8 @@ void GCMClientImpl::StartGCM() {

void GCMClientImpl::InitializeMCSClient() {
DCHECK(network_connection_tracker_);
if (base::CommandLine::ForCurrentProcess()->HasSwitch("ungoogled-supermium"))
return;
std::vector<GURL> endpoints;
endpoints.push_back(gservices_settings_.GetMCSMainEndpoint());
GURL fallback_endpoint = gservices_settings_.GetMCSFallbackEndpoint();
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 884e827

Please sign in to comment.