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 <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 MessageSendStatus status)> OnMessageSentCallback; | 97 MessageSendStatus status)> OnMessageSentCallback; |
98 | 98 |
99 MCSClient(const std::string& version_string, | 99 MCSClient(const std::string& version_string, |
100 base::Clock* clock, | 100 base::Clock* clock, |
101 ConnectionFactory* connection_factory, | 101 ConnectionFactory* connection_factory, |
102 GCMStore* gcm_store, | 102 GCMStore* gcm_store, |
103 GCMStatsRecorder* recorder, | 103 GCMStatsRecorder* recorder, |
104 scoped_ptr<base::Timer> heartbeat_timer); | 104 scoped_ptr<base::Timer> heartbeat_timer); |
105 virtual ~MCSClient(); | 105 virtual ~MCSClient(); |
106 | 106 |
| 107 HeartbeatManager* heartbeat_manager() { |
| 108 return &heartbeat_manager_; |
| 109 } |
| 110 |
107 // Initialize the client. Will load any previous id/token information as well | 111 // Initialize the client. Will load any previous id/token information as well |
108 // as unacknowledged message information from the GCM storage, if it exists, | 112 // as unacknowledged message information from the GCM storage, if it exists, |
109 // passing the id/token information back via |initialization_callback| along | 113 // passing the id/token information back via |initialization_callback| along |
110 // with a |success == true| result. If no GCM information is present (and | 114 // with a |success == true| result. If no GCM information is present (and |
111 // this is therefore a fresh client), a clean GCM store will be created and | 115 // this is therefore a fresh client), a clean GCM store will be created and |
112 // values of 0 will be returned via |initialization_callback| with | 116 // values of 0 will be returned via |initialization_callback| with |
113 // |success == true|. | 117 // |success == true|. |
114 /// If an error loading the GCM store is encountered, | 118 /// If an error loading the GCM store is encountered, |
115 // |initialization_callback| will be invoked with |success == false|. | 119 // |initialization_callback| will be invoked with |success == false|. |
116 void Initialize(const ErrorCallback& initialization_callback, | 120 void Initialize(const ErrorCallback& initialization_callback, |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 GCMStatsRecorder* recorder_; | 285 GCMStatsRecorder* recorder_; |
282 | 286 |
283 base::WeakPtrFactory<MCSClient> weak_ptr_factory_; | 287 base::WeakPtrFactory<MCSClient> weak_ptr_factory_; |
284 | 288 |
285 DISALLOW_COPY_AND_ASSIGN(MCSClient); | 289 DISALLOW_COPY_AND_ASSIGN(MCSClient); |
286 }; | 290 }; |
287 | 291 |
288 } // namespace gcm | 292 } // namespace gcm |
289 | 293 |
290 #endif // GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ | 294 #endif // GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ |
OLD | NEW |