| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ | 5 #ifndef GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ |
| 6 #define GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ | 6 #define GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 int GetResendQueueSize() const; | 148 int GetResendQueueSize() const; |
| 149 | 149 |
| 150 // Returns text representation of the state enum. | 150 // Returns text representation of the state enum. |
| 151 std::string GetStateString() const; | 151 std::string GetStateString() const; |
| 152 | 152 |
| 153 // Updates the timer used by |heartbeat_manager_| for sending heartbeats. | 153 // Updates the timer used by |heartbeat_manager_| for sending heartbeats. |
| 154 void UpdateHeartbeatTimer(std::unique_ptr<base::Timer> timer); | 154 void UpdateHeartbeatTimer(std::unique_ptr<base::Timer> timer); |
| 155 | 155 |
| 156 // Allows a caller to set a heartbeat interval (in milliseconds) with which | 156 // Allows a caller to set a heartbeat interval (in milliseconds) with which |
| 157 // the MCS connection will be monitored on both ends, to detect device | 157 // the MCS connection will be monitored on both ends, to detect device |
| 158 // presence. In case the newly set interval is less then the current one, | 158 // presence. In case the newly set interval is smaller than the current one, |
| 159 // connection will be restarted with new heartbeat interval. Valid values have | 159 // connection will be restarted with new heartbeat interval. Valid values have |
| 160 // to be between GetMax/GetMinClientHeartbeatIntervalMs of HeartbeatManager, | 160 // to be between GetMax/GetMinClientHeartbeatIntervalMs of HeartbeatManager, |
| 161 // otherwise the setting won't take effect. | 161 // otherwise the setting won't take effect. |
| 162 void AddHeartbeatInterval(const std::string& scope, int interval_ms); | 162 void AddHeartbeatInterval(const std::string& scope, int interval_ms); |
| 163 void RemoveHeartbeatInterval(const std::string& scope); | 163 void RemoveHeartbeatInterval(const std::string& scope); |
| 164 | 164 |
| 165 HeartbeatManager* GetHeartbeatManagerForTesting() { | 165 HeartbeatManager* GetHeartbeatManagerForTesting() { |
| 166 return &heartbeat_manager_; | 166 return &heartbeat_manager_; |
| 167 } | 167 } |
| 168 | 168 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 GCMStatsRecorder* recorder_; | 308 GCMStatsRecorder* recorder_; |
| 309 | 309 |
| 310 base::WeakPtrFactory<MCSClient> weak_ptr_factory_; | 310 base::WeakPtrFactory<MCSClient> weak_ptr_factory_; |
| 311 | 311 |
| 312 DISALLOW_COPY_AND_ASSIGN(MCSClient); | 312 DISALLOW_COPY_AND_ASSIGN(MCSClient); |
| 313 }; | 313 }; |
| 314 | 314 |
| 315 } // namespace gcm | 315 } // namespace gcm |
| 316 | 316 |
| 317 #endif // GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ | 317 #endif // GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ |
| OLD | NEW |