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

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: Addressing final feedback and fixing formatting 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
« no previous file with comments | « components/gcm_driver/gcm_client_impl.cc ('k') | components/gcm_driver/gcm_driver_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/gcm_driver.h
diff --git a/components/gcm_driver/gcm_driver.h b/components/gcm_driver/gcm_driver.h
index aac0975fbd351c0eb605c354ec73b702e59726ec..caae284fe837ce640da82d07d0f0338734c00813 100644
--- a/components/gcm_driver/gcm_driver.h
+++ b/components/gcm_driver/gcm_driver.h
@@ -169,6 +169,28 @@ class GCMDriver {
// Supports saving the Instance ID data in the GCM store.
virtual InstanceIDStore* GetInstanceIDStore() = 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.
+ //
+ // GCM Driver can decide to postpone the action until Client is properly
+ // initialized, hence this setting can be called at any time.
+ //
+ // Server can overwrite the setting to a different value.
+ //
+ // |scope| is used to identify the component that requests a custom interval
+ // to be set, and allows that component to later revoke the setting.
+ // |interval_ms| should be between 2 minues and 15 minues (28 minues on
+ // cellular networks). For details check
+ // GetMin/MaxClientHeartbeatItnervalMs() in HeartbeatManager.
+ virtual void AddHeartbeatInterval(const std::string& scope,
+ 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;
« no previous file with comments | « components/gcm_driver/gcm_client_impl.cc ('k') | components/gcm_driver/gcm_driver_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698