| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ |
| 6 #define COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ | 6 #define COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 // Called when activities are being recorded and a new activity has just | 205 // Called when activities are being recorded and a new activity has just |
| 206 // been recorded. | 206 // been recorded. |
| 207 virtual void OnActivityRecorded() = 0; | 207 virtual void OnActivityRecorded() = 0; |
| 208 | 208 |
| 209 // Called when a new connection is established and a successful handshake | 209 // Called when a new connection is established and a successful handshake |
| 210 // has been performed. | 210 // has been performed. |
| 211 virtual void OnConnected(const net::IPEndPoint& ip_endpoint) = 0; | 211 virtual void OnConnected(const net::IPEndPoint& ip_endpoint) = 0; |
| 212 | 212 |
| 213 // Called when the connection is interrupted. | 213 // Called when the connection is interrupted. |
| 214 virtual void OnDisconnected() = 0; | 214 virtual void OnDisconnected() = 0; |
| 215 |
| 216 // Called when the GCM store is reset (e.g. due to corruption), which |
| 217 // changes the device ID, invalidating all prior registrations. |
| 218 virtual void OnStoreReset() = 0; |
| 215 }; | 219 }; |
| 216 | 220 |
| 217 GCMClient(); | 221 GCMClient(); |
| 218 virtual ~GCMClient(); | 222 virtual ~GCMClient(); |
| 219 | 223 |
| 220 // Begins initialization of the GCM Client. This will not trigger a | 224 // Begins initialization of the GCM Client. This will not trigger a |
| 221 // connection. | 225 // connection. |
| 222 // |chrome_build_info|: chrome info, i.e., version, channel and etc. | 226 // |chrome_build_info|: chrome info, i.e., version, channel and etc. |
| 223 // |store_path|: path to the GCM store. | 227 // |store_path|: path to the GCM store. |
| 224 // |blocking_task_runner|: for running blocking file tasks. | 228 // |blocking_task_runner|: for running blocking file tasks. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 // to be set, and allows that component to later revoke the setting. It should | 328 // to be set, and allows that component to later revoke the setting. It should |
| 325 // be unique. | 329 // be unique. |
| 326 virtual void AddHeartbeatInterval(const std::string& scope, | 330 virtual void AddHeartbeatInterval(const std::string& scope, |
| 327 int interval_ms) = 0; | 331 int interval_ms) = 0; |
| 328 virtual void RemoveHeartbeatInterval(const std::string& scope) = 0; | 332 virtual void RemoveHeartbeatInterval(const std::string& scope) = 0; |
| 329 }; | 333 }; |
| 330 | 334 |
| 331 } // namespace gcm | 335 } // namespace gcm |
| 332 | 336 |
| 333 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ | 337 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ |
| OLD | NEW |