Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: components/gcm_driver/gcm_client.h

Issue 445683003: [GCM] Exposing persistence of account mappings in GCM Driver (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updates based on self review Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 12 matching lines...) Expand all
23 } 23 }
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 34
34 // Interface that encapsulates the network communications with the Google Cloud 35 // Interface that encapsulates the network communications with the Google Cloud
35 // Messaging server. This interface is not supposed to be thread-safe. 36 // Messaging server. This interface is not supposed to be thread-safe.
36 class GCMClient { 37 class GCMClient {
37 public: 38 public:
38 enum Result { 39 enum Result {
39 // Successful operation. 40 // Successful operation.
40 SUCCESS, 41 SUCCESS,
41 // Invalid parameter. 42 // Invalid parameter.
42 INVALID_PARAMETER, 43 INVALID_PARAMETER,
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 // Clear all recorded GCM activity logs. 270 // Clear all recorded GCM activity logs.
270 virtual void ClearActivityLogs() = 0; 271 virtual void ClearActivityLogs() = 0;
271 272
272 // Gets internal states and statistics. 273 // Gets internal states and statistics.
273 virtual GCMStatistics GetStatistics() const = 0; 274 virtual GCMStatistics GetStatistics() const = 0;
274 275
275 // Sets a list of accounts with OAuth2 tokens for the next checkin. 276 // Sets a list of accounts with OAuth2 tokens for the next checkin.
276 // |account_tokens| maps email addresses to OAuth2 access tokens. 277 // |account_tokens| maps email addresses to OAuth2 access tokens.
277 virtual void SetAccountsForCheckin( 278 virtual void SetAccountsForCheckin(
278 const std::map<std::string, std::string>& account_tokens) = 0; 279 const std::map<std::string, std::string>& account_tokens) = 0;
280
281 // Persists the |account_mapping| in the store.
282 virtual void UpdateAccountMapping(const AccountMapping& account_mapping) = 0;
283
284 // Removes the account mapping related to |account_id| from the persistent
285 // store.
286 virtual void RemoveAccountMapping(const std::string& account_id) = 0;
279 }; 287 };
280 288
281 } // namespace gcm 289 } // namespace gcm
282 290
283 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ 291 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698