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

Unified Diff: google_apis/gcm/engine/heartbeat_manager.cc

Issue 745123002: Link GCM heartbeat with wake on wifi preference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make GCM wake from suspend aware Created 6 years 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
Index: google_apis/gcm/engine/heartbeat_manager.cc
diff --git a/google_apis/gcm/engine/heartbeat_manager.cc b/google_apis/gcm/engine/heartbeat_manager.cc
index b6b0e8892ebb91d357d54365054f6531a8086dfa..88562fd75bab06933bf744b025dd7a2332a1dde4 100644
--- a/google_apis/gcm/engine/heartbeat_manager.cc
+++ b/google_apis/gcm/engine/heartbeat_manager.cc
@@ -80,6 +80,16 @@ base::TimeTicks HeartbeatManager::GetNextHeartbeatTime() const {
return base::TimeTicks();
}
+void HeartbeatManager::UpdateHeartbeatTimer(scoped_ptr<base::Timer> timer) {
+ bool was_running = heartbeat_timer_->IsRunning();
+
+ Stop();
Nicolas Zea 2014/12/05 00:53:05 I don't think you should be calling Stop() here. I
Chirantan Ekbote 2014/12/05 21:49:05 Done.
+ heartbeat_timer_ = timer.Pass();
+
+ if (was_running)
+ RestartTimer();
+}
+
void HeartbeatManager::OnHeartbeatTriggered() {
// Reset the weak pointers used for heartbeat checks.
weak_ptr_factory_.InvalidateWeakPtrs();

Powered by Google App Engine
This is Rietveld 408576698