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

Side by Side Diff: google_apis/gcm/engine/gcm_store.h

Issue 600053002: [GCM] Loading the account mappings from store to the driver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing account mapper from BUILD.gn android section Created 6 years, 2 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
« no previous file with comments | « components/gcm_driver/gcm_driver_desktop.cc ('k') | google_apis/gcm/engine/gcm_store_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 GOOGLE_APIS_GCM_ENGINE_GCM_STORE_H_ 5 #ifndef GOOGLE_APIS_GCM_ENGINE_GCM_STORE_H_
6 #define GOOGLE_APIS_GCM_ENGINE_GCM_STORE_H_ 6 #define GOOGLE_APIS_GCM_ENGINE_GCM_STORE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 16 matching lines...) Expand all
27 class MCSMessage; 27 class MCSMessage;
28 28
29 // A GCM data store interface. GCM Store will handle persistence portion of RMQ, 29 // A GCM data store interface. GCM Store will handle persistence portion of RMQ,
30 // as well as store device and user checkin information. 30 // as well as store device and user checkin information.
31 class GCM_EXPORT GCMStore { 31 class GCM_EXPORT GCMStore {
32 public: 32 public:
33 // Map of message id to message data for outgoing messages. 33 // Map of message id to message data for outgoing messages.
34 typedef std::map<std::string, linked_ptr<google::protobuf::MessageLite> > 34 typedef std::map<std::string, linked_ptr<google::protobuf::MessageLite> >
35 OutgoingMessageMap; 35 OutgoingMessageMap;
36 36
37 // Map of account id to account info for account mappings. 37 // List of account mappings.
38 typedef std::map<std::string, AccountMapping> AccountMappingMap; 38 typedef std::vector<AccountMapping> AccountMappings;
39 39
40 // Container for Load(..) results. 40 // Container for Load(..) results.
41 struct GCM_EXPORT LoadResult { 41 struct GCM_EXPORT LoadResult {
42 LoadResult(); 42 LoadResult();
43 ~LoadResult(); 43 ~LoadResult();
44 44
45 void Reset(); 45 void Reset();
46 46
47 bool success; 47 bool success;
48 uint64 device_android_id; 48 uint64 device_android_id;
49 uint64 device_security_token; 49 uint64 device_security_token;
50 RegistrationInfoMap registrations; 50 RegistrationInfoMap registrations;
51 std::vector<std::string> incoming_messages; 51 std::vector<std::string> incoming_messages;
52 OutgoingMessageMap outgoing_messages; 52 OutgoingMessageMap outgoing_messages;
53 std::map<std::string, std::string> gservices_settings; 53 std::map<std::string, std::string> gservices_settings;
54 std::string gservices_digest; 54 std::string gservices_digest;
55 base::Time last_checkin_time; 55 base::Time last_checkin_time;
56 std::set<std::string> last_checkin_accounts; 56 std::set<std::string> last_checkin_accounts;
57 AccountMappingMap account_mappings; 57 AccountMappings account_mappings;
58 }; 58 };
59 59
60 typedef std::vector<std::string> PersistentIdList; 60 typedef std::vector<std::string> PersistentIdList;
61 typedef base::Callback<void(scoped_ptr<LoadResult> result)> LoadCallback; 61 typedef base::Callback<void(scoped_ptr<LoadResult> result)> LoadCallback;
62 typedef base::Callback<void(bool success)> UpdateCallback; 62 typedef base::Callback<void(bool success)> UpdateCallback;
63 63
64 GCMStore(); 64 GCMStore();
65 virtual ~GCMStore(); 65 virtual ~GCMStore();
66 66
67 // Load the data from persistent store and pass the initial state back to 67 // Load the data from persistent store and pass the initial state back to
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 virtual void RemoveAccountMapping(const std::string& account_id, 128 virtual void RemoveAccountMapping(const std::string& account_id,
129 const UpdateCallback& callback) = 0; 129 const UpdateCallback& callback) = 0;
130 130
131 private: 131 private:
132 DISALLOW_COPY_AND_ASSIGN(GCMStore); 132 DISALLOW_COPY_AND_ASSIGN(GCMStore);
133 }; 133 };
134 134
135 } // namespace gcm 135 } // namespace gcm
136 136
137 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_H_ 137 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_H_
OLDNEW
« no previous file with comments | « components/gcm_driver/gcm_driver_desktop.cc ('k') | google_apis/gcm/engine/gcm_store_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698