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 13 matching lines...) Expand all Loading... | |
24 | 24 |
25 namespace net { | 25 namespace net { |
26 class IPEndPoint; | 26 class IPEndPoint; |
27 class URLRequestContextGetter; | 27 class URLRequestContextGetter; |
28 } | 28 } |
29 | 29 |
30 namespace gcm { | 30 namespace gcm { |
31 | 31 |
32 class Encryptor; | 32 class Encryptor; |
33 struct AccountMapping; | 33 struct AccountMapping; |
34 class MCSClient; | |
34 | 35 |
35 // Interface that encapsulates the network communications with the Google Cloud | 36 // Interface that encapsulates the network communications with the Google Cloud |
36 // Messaging server. This interface is not supposed to be thread-safe. | 37 // Messaging server. This interface is not supposed to be thread-safe. |
37 class GCMClient { | 38 class GCMClient { |
38 public: | 39 public: |
39 enum Result { | 40 enum Result { |
40 // Successful operation. | 41 // Successful operation. |
41 SUCCESS, | 42 SUCCESS, |
42 // Invalid parameter. | 43 // Invalid parameter. |
43 INVALID_PARAMETER, | 44 INVALID_PARAMETER, |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
292 | 293 |
293 // Persists the |account_mapping| in the store. | 294 // Persists the |account_mapping| in the store. |
294 virtual void UpdateAccountMapping(const AccountMapping& account_mapping) = 0; | 295 virtual void UpdateAccountMapping(const AccountMapping& account_mapping) = 0; |
295 | 296 |
296 // Removes the account mapping related to |account_id| from the persistent | 297 // Removes the account mapping related to |account_id| from the persistent |
297 // store. | 298 // store. |
298 virtual void RemoveAccountMapping(const std::string& account_id) = 0; | 299 virtual void RemoveAccountMapping(const std::string& account_id) = 0; |
299 | 300 |
300 // Sets last token fetch time in persistent store. | 301 // Sets last token fetch time in persistent store. |
301 virtual void SetLastTokenFetchTime(const base::Time& time) = 0; | 302 virtual void SetLastTokenFetchTime(const base::Time& time) = 0; |
303 | |
304 // Gets the MCSClient associated with this GCMClient or NULL if one does not | |
305 // exist yet. | |
306 virtual MCSClient* GetMCSClient() const = 0; | |
Nicolas Zea
2014/12/05 00:53:04
I'm not a fan of exposing all the logic of MCSClie
Chirantan Ekbote
2014/12/05 21:49:05
Done.
| |
302 }; | 307 }; |
303 | 308 |
304 } // namespace gcm | 309 } // namespace gcm |
305 | 310 |
306 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ | 311 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ |
OLD | NEW |