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

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

Issue 1357053003: [GCM] Be more aggressive about triggering heartbeats when waking from sleep (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self review Created 5 years, 3 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 | « no previous file | google_apis/gcm/engine/heartbeat_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/engine/heartbeat_manager.h
diff --git a/google_apis/gcm/engine/heartbeat_manager.h b/google_apis/gcm/engine/heartbeat_manager.h
index a6d47ea241f2cecc4958875e04ac336730832ddc..83a25cfda5271e24a898547782c736752d2ee0e6 100644
--- a/google_apis/gcm/engine/heartbeat_manager.h
+++ b/google_apis/gcm/engine/heartbeat_manager.h
@@ -61,6 +61,7 @@ class GCM_EXPORT HeartbeatManager : public base::PowerObserver {
void UpdateHeartbeatTimer(scoped_ptr<base::Timer> timer);
// base::PowerObserver override.
+ void OnSuspend() override;
void OnResume() override;
// Maximum and minimum of the custom client interval that can be requested,
@@ -114,6 +115,9 @@ class GCM_EXPORT HeartbeatManager : public base::PowerObserver {
// Timer for triggering heartbeats.
scoped_ptr<base::Timer> heartbeat_timer_;
+ // Time at which the machine was last suspended.
+ base::Time suspend_time_;
+
// Callbacks for interacting with the the connection.
base::Closure send_heartbeat_callback_;
ReconnectCallback trigger_reconnect_callback_;
« no previous file with comments | « no previous file | google_apis/gcm/engine/heartbeat_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698