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

Unified Diff: components/gcm_driver/gcm_driver.h

Issue 1124783002: [GCM] Wiring heartbeat interval calls to GCMDriver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@store-heartbeat-gcm
Patch Set: Adding MCS client tests for storing heartbeat interval Created 5 years, 7 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
Index: components/gcm_driver/gcm_driver.h
diff --git a/components/gcm_driver/gcm_driver.h b/components/gcm_driver/gcm_driver.h
index fb20f3ac3af6435e31771301fcb296c98f15d9ce..a0ed95754049df3bd8740db78eff698238766132 100644
--- a/components/gcm_driver/gcm_driver.h
+++ b/components/gcm_driver/gcm_driver.h
@@ -146,6 +146,18 @@ class GCMDriver {
// to send a heartbeat message.
virtual void WakeFromSuspendForHeartbeat(bool wake) = 0;
+ // Adds or removes a custom client requested heartbeat interval. If multiple
+ // components set that setting, the lowest setting will be used. If the
+ // setting is outside of GetMax/MinClientHeartbeatIntervalMs() it will be
+ // ignored. If a new setting is less than the currently used, the connection
+ // will be reset with the new heartbeat. Client that no longer require
+ // aggressive heartbeats, should remove their requested interval. Heartbeats
+ // set this way survive connection/Chrome restart.
+ // Server can overwrite the setting to a different value.
+ virtual void AddHeartbeatInterval(const std::string& scope,
Nicolas Zea 2015/05/07 18:13:52 nit: describe what scope is and how it should be s
fgorski 2015/05/10 06:44:34 Done.
+ int interval_ms) = 0;
+ virtual void RemoveHeartbeatInterval(const std::string& scope) = 0;
+
protected:
// Ensures that the GCM service starts (if necessary conditions are met).
virtual GCMClient::Result EnsureStarted(GCMClient::StartMode start_mode) = 0;

Powered by Google App Engine
This is Rietveld 408576698