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

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

Issue 215363007: [GCM] Adding basic G-services handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebasing Created 6 years, 8 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 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 30 matching lines...) Expand all
41 struct GCM_EXPORT LoadResult { 41 struct GCM_EXPORT LoadResult {
42 LoadResult(); 42 LoadResult();
43 ~LoadResult(); 43 ~LoadResult();
44 44
45 bool success; 45 bool success;
46 uint64 device_android_id; 46 uint64 device_android_id;
47 uint64 device_security_token; 47 uint64 device_security_token;
48 RegistrationInfoMap registrations; 48 RegistrationInfoMap registrations;
49 std::vector<std::string> incoming_messages; 49 std::vector<std::string> incoming_messages;
50 OutgoingMessageMap outgoing_messages; 50 OutgoingMessageMap outgoing_messages;
51 std::map<std::string, std::string> gservices_settings;
52 std::string gservices_digest;
51 base::Time last_checkin_time; 53 base::Time last_checkin_time;
52 }; 54 };
53 55
54 typedef std::vector<std::string> PersistentIdList; 56 typedef std::vector<std::string> PersistentIdList;
55 typedef base::Callback<void(scoped_ptr<LoadResult> result)> LoadCallback; 57 typedef base::Callback<void(scoped_ptr<LoadResult> result)> LoadCallback;
56 typedef base::Callback<void(bool success)> UpdateCallback; 58 typedef base::Callback<void(bool success)> UpdateCallback;
57 59
58 GCMStore(); 60 GCMStore();
59 virtual ~GCMStore(); 61 virtual ~GCMStore();
60 62
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 const UpdateCallback& callback) = 0; 102 const UpdateCallback& callback) = 0;
101 virtual void RemoveOutgoingMessage(const std::string& persistent_id, 103 virtual void RemoveOutgoingMessage(const std::string& persistent_id,
102 const UpdateCallback& callback) = 0; 104 const UpdateCallback& callback) = 0;
103 virtual void RemoveOutgoingMessages(const PersistentIdList& persistent_ids, 105 virtual void RemoveOutgoingMessages(const PersistentIdList& persistent_ids,
104 const UpdateCallback& callback) = 0; 106 const UpdateCallback& callback) = 0;
105 107
106 // Sets last device's checkin time. 108 // Sets last device's checkin time.
107 virtual void SetLastCheckinTime(const base::Time& last_checkin_time, 109 virtual void SetLastCheckinTime(const base::Time& last_checkin_time,
108 const UpdateCallback& callback) = 0; 110 const UpdateCallback& callback) = 0;
109 111
112 // G-service settings handling.
113 // Persists |settings|, |settings_digest| and |last_checkin_time|. It
Nicolas Zea 2014/04/04 20:09:56 nit: remove mention of last checkin time.
114 // completely replaces the existing data.
115 virtual void SetGServicesSettings(
116 const std::map<std::string, std::string>& settings,
117 const std::string& settings_digest,
118 const UpdateCallback& callback) = 0;
119
110 private: 120 private:
111 DISALLOW_COPY_AND_ASSIGN(GCMStore); 121 DISALLOW_COPY_AND_ASSIGN(GCMStore);
112 }; 122 };
113 123
114 } // namespace gcm 124 } // namespace gcm
115 125
116 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_H_ 126 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_H_
OLDNEW
« no previous file with comments | « google_apis/gcm/engine/checkin_request_unittest.cc ('k') | google_apis/gcm/engine/gcm_store_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698