disable-gcm.patch 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # Disable Google Cloud Messaging (GCM) client
  2. --- a/components/gcm_driver/gcm_client_impl.cc
  3. +++ b/components/gcm_driver/gcm_client_impl.cc
  4. @@ -467,6 +467,7 @@ void GCMClientImpl::StartGCM() {
  5. void GCMClientImpl::InitializeMCSClient() {
  6. DCHECK(network_connection_tracker_);
  7. + return;
  8. std::vector<GURL> endpoints;
  9. endpoints.push_back(gservices_settings_.GetMCSMainEndpoint());
  10. GURL fallback_endpoint = gservices_settings_.GetMCSFallbackEndpoint();
  11. @@ -672,27 +673,6 @@ void GCMClientImpl::RemoveHeartbeatInter
  12. void GCMClientImpl::StartCheckin() {
  13. DCHECK(io_task_runner_->RunsTasksInCurrentSequence());
  14. -
  15. - // Make sure no checkin is in progress.
  16. - if (checkin_request_)
  17. - return;
  18. -
  19. - checkin_proto::ChromeBuildProto chrome_build_proto;
  20. - ToCheckinProtoVersion(chrome_build_info_, &chrome_build_proto);
  21. - CheckinRequest::RequestInfo request_info(device_checkin_info_.android_id,
  22. - device_checkin_info_.secret,
  23. - device_checkin_info_.account_tokens,
  24. - gservices_settings_.digest(),
  25. - chrome_build_proto);
  26. - checkin_request_.reset(new CheckinRequest(
  27. - gservices_settings_.GetCheckinURL(), request_info, GetGCMBackoffPolicy(),
  28. - base::BindOnce(&GCMClientImpl::OnCheckinCompleted,
  29. - weak_ptr_factory_.GetWeakPtr()),
  30. - url_loader_factory_, io_task_runner_, &recorder_));
  31. - // Taking a snapshot of the accounts count here, as there might be an asynch
  32. - // update of the account tokens while checkin is in progress.
  33. - device_checkin_info_.SnapshotCheckinAccounts();
  34. - checkin_request_->Start();
  35. }
  36. void GCMClientImpl::OnCheckinCompleted(
  37. @@ -749,24 +729,6 @@ void GCMClientImpl::SetGServicesSettings
  38. void GCMClientImpl::SchedulePeriodicCheckin() {
  39. DCHECK(io_task_runner_->RunsTasksInCurrentSequence());
  40. -
  41. - // Make sure no checkin is in progress.
  42. - if (checkin_request_.get() || !device_checkin_info_.accounts_set)
  43. - return;
  44. -
  45. - // There should be only one periodic checkin pending at a time. Removing
  46. - // pending periodic checkin to schedule a new one.
  47. - periodic_checkin_ptr_factory_.InvalidateWeakPtrs();
  48. -
  49. - base::TimeDelta time_to_next_checkin = GetTimeToNextCheckin();
  50. - if (time_to_next_checkin < base::TimeDelta())
  51. - time_to_next_checkin = base::TimeDelta();
  52. -
  53. - io_task_runner_->PostDelayedTask(
  54. - FROM_HERE,
  55. - base::BindOnce(&GCMClientImpl::StartCheckin,
  56. - periodic_checkin_ptr_factory_.GetWeakPtr()),
  57. - time_to_next_checkin);
  58. }
  59. base::TimeDelta GCMClientImpl::GetTimeToNextCheckin() const {