Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Unified Diff: components/gcm_driver/gcm_channel_status_syncer.cc

Issue 657703002: Revert of [GCM] Start GCMChannelStatusSyncer when GCM is disabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/gcm_driver/gcm_channel_status_syncer.h ('k') | components/gcm_driver/gcm_driver_desktop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/gcm_channel_status_syncer.cc
diff --git a/components/gcm_driver/gcm_channel_status_syncer.cc b/components/gcm_driver/gcm_channel_status_syncer.cc
index 4be2eae0325cd7a403e9a7c0777acd391cc6bc19..443c90d57b8207f63390f8860cf8784b30ba594c 100644
--- a/components/gcm_driver/gcm_channel_status_syncer.cc
+++ b/components/gcm_driver/gcm_channel_status_syncer.cc
@@ -111,8 +111,7 @@
weak_ptr_factory_.InvalidateWeakPtrs();
}
-void GCMChannelStatusSyncer::OnRequestCompleted(bool update_received,
- bool enabled,
+void GCMChannelStatusSyncer::OnRequestCompleted(bool enabled,
int poll_interval_seconds) {
DCHECK(request_);
request_.reset();
@@ -122,23 +121,20 @@
prefs_->SetInt64(kGCMChannelLastCheckTime,
last_check_time_.ToInternalValue());
- if (update_received) {
- if (gcm_enabled_ != enabled) {
- gcm_enabled_ = enabled;
- prefs_->SetBoolean(kGCMChannelStatus, enabled);
- if (gcm_enabled_)
- driver_->Enable();
- else
- driver_->Disable();
- }
+ if (gcm_enabled_ != enabled) {
+ gcm_enabled_ = enabled;
+ prefs_->SetBoolean(kGCMChannelStatus, enabled);
+ if (gcm_enabled_)
+ driver_->Enable();
+ else
+ driver_->Disable();
+ }
- DCHECK_GE(poll_interval_seconds,
- GCMChannelStatusRequest::min_poll_interval_seconds());
- if (poll_interval_seconds_ != poll_interval_seconds) {
- poll_interval_seconds_ = poll_interval_seconds;
- prefs_->SetInteger(kGCMChannelPollIntervalSeconds,
- poll_interval_seconds_);
- }
+ DCHECK_GE(poll_interval_seconds,
+ GCMChannelStatusRequest::min_poll_interval_seconds());
+ if (poll_interval_seconds_ != poll_interval_seconds) {
+ poll_interval_seconds_ = poll_interval_seconds;
+ prefs_->SetInteger(kGCMChannelPollIntervalSeconds, poll_interval_seconds_);
}
ScheduleRequest();
« no previous file with comments | « components/gcm_driver/gcm_channel_status_syncer.h ('k') | components/gcm_driver/gcm_driver_desktop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698