summaryrefslogtreecommitdiff
path: root/www/chromium-uc/patches/core/ungoogled-chromium/disable-gcm.patch
diff options
context:
space:
mode:
Diffstat (limited to 'www/chromium-uc/patches/core/ungoogled-chromium/disable-gcm.patch')
-rw-r--r--www/chromium-uc/patches/core/ungoogled-chromium/disable-gcm.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/disable-gcm.patch b/www/chromium-uc/patches/core/ungoogled-chromium/disable-gcm.patch
new file mode 100644
index 0000000..bafa024
--- /dev/null
+++ b/www/chromium-uc/patches/core/ungoogled-chromium/disable-gcm.patch
@@ -0,0 +1,65 @@
1# Disable Google Cloud Messaging (GCM) client
2
3--- components/gcm_driver/gcm_client_impl.cc.orig
4+++ components/gcm_driver/gcm_client_impl.cc
5@@ -465,6 +465,7 @@ void GCMClientImpl::StartGCM() {
6
7 void GCMClientImpl::InitializeMCSClient() {
8 DCHECK(network_connection_tracker_);
9+ return;
10 std::vector<GURL> endpoints;
11 endpoints.push_back(gservices_settings_.GetMCSMainEndpoint());
12 GURL fallback_endpoint = gservices_settings_.GetMCSFallbackEndpoint();
13@@ -670,27 +671,6 @@ void GCMClientImpl::RemoveHeartbeatInter
14
15 void GCMClientImpl::StartCheckin() {
16 DCHECK(io_task_runner_->RunsTasksInCurrentSequence());
17-
18- // Make sure no checkin is in progress.
19- if (checkin_request_)
20- return;
21-
22- checkin_proto::ChromeBuildProto chrome_build_proto;
23- ToCheckinProtoVersion(chrome_build_info_, &chrome_build_proto);
24- CheckinRequest::RequestInfo request_info(device_checkin_info_.android_id,
25- device_checkin_info_.secret,
26- device_checkin_info_.account_tokens,
27- gservices_settings_.digest(),
28- chrome_build_proto);
29- checkin_request_ = std::make_unique<CheckinRequest>(
30- gservices_settings_.GetCheckinURL(), request_info, GetGCMBackoffPolicy(),
31- base::BindOnce(&GCMClientImpl::OnCheckinCompleted,
32- weak_ptr_factory_.GetWeakPtr()),
33- url_loader_factory_, io_task_runner_, &recorder_);
34- // Taking a snapshot of the accounts count here, as there might be an asynch
35- // update of the account tokens while checkin is in progress.
36- device_checkin_info_.SnapshotCheckinAccounts();
37- checkin_request_->Start();
38 }
39
40 void GCMClientImpl::OnCheckinCompleted(
41@@ -747,24 +727,6 @@ void GCMClientImpl::SetGServicesSettings
42
43 void GCMClientImpl::SchedulePeriodicCheckin() {
44 DCHECK(io_task_runner_->RunsTasksInCurrentSequence());
45-
46- // Make sure no checkin is in progress.
47- if (checkin_request_.get() || !device_checkin_info_.accounts_set)
48- return;
49-
50- // There should be only one periodic checkin pending at a time. Removing
51- // pending periodic checkin to schedule a new one.
52- periodic_checkin_ptr_factory_.InvalidateWeakPtrs();
53-
54- base::TimeDelta time_to_next_checkin = GetTimeToNextCheckin();
55- if (time_to_next_checkin < base::TimeDelta())
56- time_to_next_checkin = base::TimeDelta();
57-
58- io_task_runner_->PostDelayedTask(
59- FROM_HERE,
60- base::BindOnce(&GCMClientImpl::StartCheckin,
61- periodic_checkin_ptr_factory_.GetWeakPtr()),
62- time_to_next_checkin);
63 }
64
65 base::TimeDelta GCMClientImpl::GetTimeToNextCheckin() const {