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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // |app_id|: application ID. | 196 // |app_id|: application ID. |
197 // |message_id|: ID of the acknowledged message. | 197 // |message_id|: ID of the acknowledged message. |
198 virtual void OnSendAcknowledged(const std::string& app_id, | 198 virtual void OnSendAcknowledged(const std::string& app_id, |
199 const std::string& message_id) = 0; | 199 const std::string& message_id) = 0; |
200 | 200 |
201 // Called when the GCM becomes ready. To get to this state, GCMClient | 201 // Called when the GCM becomes ready. To get to this state, GCMClient |
202 // finished loading from the GCM store and retrieved the device check-in | 202 // finished loading from the GCM store and retrieved the device check-in |
203 // from the server if it hadn't yet. | 203 // from the server if it hadn't yet. |
204 // |account_mappings|: a persisted list of accounts mapped to this GCM | 204 // |account_mappings|: a persisted list of accounts mapped to this GCM |
205 // client. | 205 // client. |
| 206 // |last_token_fetching_time|: a timestamp of a last successful token fetch. |
206 virtual void OnGCMReady( | 207 virtual void OnGCMReady( |
207 const std::vector<AccountMapping>& account_mappings) = 0; | 208 const std::vector<AccountMapping>& account_mappings, |
| 209 const base::Time& last_token_fetching_time) = 0; |
208 | 210 |
209 // Called when activities are being recorded and a new activity has just | 211 // Called when activities are being recorded and a new activity has just |
210 // been recorded. | 212 // been recorded. |
211 virtual void OnActivityRecorded() = 0; | 213 virtual void OnActivityRecorded() = 0; |
212 | 214 |
213 // Called when a new connection is established and a successful handshake | 215 // Called when a new connection is established and a successful handshake |
214 // has been performed. | 216 // has been performed. |
215 virtual void OnConnected(const net::IPEndPoint& ip_endpoint) = 0; | 217 virtual void OnConnected(const net::IPEndPoint& ip_endpoint) = 0; |
216 | 218 |
217 // Called when the connection is interrupted. | 219 // Called when the connection is interrupted. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 // tokens. | 290 // tokens. |
289 virtual void SetAccountTokens( | 291 virtual void SetAccountTokens( |
290 const std::vector<AccountTokenInfo>& account_tokens) = 0; | 292 const std::vector<AccountTokenInfo>& account_tokens) = 0; |
291 | 293 |
292 // Persists the |account_mapping| in the store. | 294 // Persists the |account_mapping| in the store. |
293 virtual void UpdateAccountMapping(const AccountMapping& account_mapping) = 0; | 295 virtual void UpdateAccountMapping(const AccountMapping& account_mapping) = 0; |
294 | 296 |
295 // Removes the account mapping related to |account_id| from the persistent | 297 // Removes the account mapping related to |account_id| from the persistent |
296 // store. | 298 // store. |
297 virtual void RemoveAccountMapping(const std::string& account_id) = 0; | 299 virtual void RemoveAccountMapping(const std::string& account_id) = 0; |
| 300 |
| 301 // Sets last token fetching time in persistent store. |
| 302 virtual void SetLastTokenFetchingTime(const base::Time& time) = 0; |
298 }; | 303 }; |
299 | 304 |
300 } // namespace gcm | 305 } // namespace gcm |
301 | 306 |
302 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ | 307 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ |
OLD | NEW |