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

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

Issue 135303002: Adding a user list (to be consumed by GCM Client Implementation) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated the code with CR feedback, applied more asynch model. Created 6 years, 11 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 | « no previous file | google_apis/gcm/engine/gcm_store.cc » ('j') | google_apis/gcm/engine/user_list.h » ('J')
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 <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 10 matching lines...) Expand all
21 } // namespace google 21 } // namespace google
22 22
23 namespace gcm { 23 namespace gcm {
24 24
25 class MCSMessage; 25 class MCSMessage;
26 26
27 // A GCM data store interface. GCM Store will handle persistence portion of RMQ, 27 // A GCM data store interface. GCM Store will handle persistence portion of RMQ,
28 // as well as store device and user checkin information. 28 // as well as store device and user checkin information.
29 class GCM_EXPORT GCMStore { 29 class GCM_EXPORT GCMStore {
30 public: 30 public:
31 // Part of load results storing user serial number mapping related values.
32 struct GCM_EXPORT SerialNumberMappings {
jianli 2014/01/15 01:07:09 nit: probably simpler to name as SerialNumberMap
fgorski 2014/01/15 01:29:21 map has implications.
33 SerialNumberMappings();
34 ~SerialNumberMappings();
35
36 int64 next_serial_number;
37 std::map<std::string, int64> user_serial_numbers;
38 };
39
31 // Container for Load(..) results. 40 // Container for Load(..) results.
32 struct GCM_EXPORT LoadResult { 41 struct GCM_EXPORT LoadResult {
33 LoadResult(); 42 LoadResult();
34 ~LoadResult(); 43 ~LoadResult();
35 44
36 bool success; 45 bool success;
37 uint64 device_android_id; 46 uint64 device_android_id;
38 uint64 device_security_token; 47 uint64 device_security_token;
39 std::vector<std::string> incoming_messages; 48 std::vector<std::string> incoming_messages;
40 std::map<std::string, google::protobuf::MessageLite*> outgoing_messages; 49 std::map<std::string, google::protobuf::MessageLite*> outgoing_messages;
41 int64 next_serial_number; 50 SerialNumberMappings serial_number_mappings;
42 std::map<std::string, int64> user_serial_numbers;
43 }; 51 };
44 52
45 typedef std::vector<std::string> PersistentIdList; 53 typedef std::vector<std::string> PersistentIdList;
46 // Note: callee receives ownership of |outgoing_messages|' values. 54 // Note: callee receives ownership of |outgoing_messages|' values.
47 typedef base::Callback<void(const LoadResult& result)> LoadCallback; 55 typedef base::Callback<void(const LoadResult& result)> LoadCallback;
48 typedef base::Callback<void(bool success)> UpdateCallback; 56 typedef base::Callback<void(bool success)> UpdateCallback;
49 57
50 GCMStore(); 58 GCMStore();
51 virtual ~GCMStore(); 59 virtual ~GCMStore();
52 60
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 virtual void RemoveUserSerialNumber(const std::string& username, 99 virtual void RemoveUserSerialNumber(const std::string& username,
92 const UpdateCallback& callback) = 0; 100 const UpdateCallback& callback) = 0;
93 101
94 private: 102 private:
95 DISALLOW_COPY_AND_ASSIGN(GCMStore); 103 DISALLOW_COPY_AND_ASSIGN(GCMStore);
96 }; 104 };
97 105
98 } // namespace gcm 106 } // namespace gcm
99 107
100 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_H_ 108 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_H_
OLDNEW
« no previous file with comments | « no previous file | google_apis/gcm/engine/gcm_store.cc » ('j') | google_apis/gcm/engine/user_list.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698