Chromium Code Reviews| 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..b5f11186c54547ad95f3809cdde7ce130b30e53a 100644 |
| --- a/components/gcm_driver/gcm_driver.h |
| +++ b/components/gcm_driver/gcm_driver.h |
| @@ -169,6 +169,27 @@ 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 and 15 (28 on cellular networks). For |
|
Nicolas Zea
2015/05/13 17:57:36
2 and 15 are in units of minutes right? I'd call t
fgorski
2015/05/13 18:59:16
Done.
|
| + // 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; |