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