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 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 <google/protobuf/message_lite.h> |
| 9 #include <stdint.h> |
| 10 |
8 #include <map> | 11 #include <map> |
| 12 #include <memory> |
9 #include <set> | 13 #include <set> |
10 #include <string> | 14 #include <string> |
11 #include <vector> | 15 #include <vector> |
12 | 16 |
13 #include <google/protobuf/message_lite.h> | |
14 #include <stdint.h> | |
15 | |
16 #include "base/callback_forward.h" | 17 #include "base/callback_forward.h" |
17 #include "base/macros.h" | 18 #include "base/macros.h" |
18 #include "base/memory/linked_ptr.h" | 19 #include "base/memory/linked_ptr.h" |
19 #include "base/memory/ref_counted.h" | 20 #include "base/memory/ref_counted.h" |
20 #include "base/memory/scoped_ptr.h" | |
21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
22 #include "google_apis/gcm/base/gcm_export.h" | 22 #include "google_apis/gcm/base/gcm_export.h" |
23 #include "google_apis/gcm/engine/account_mapping.h" | 23 #include "google_apis/gcm/engine/account_mapping.h" |
24 | 24 |
25 namespace gcm { | 25 namespace gcm { |
26 | 26 |
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. |
(...skipping 29 matching lines...) Expand all Loading... |
60 std::string gservices_digest; | 60 std::string gservices_digest; |
61 base::Time last_checkin_time; | 61 base::Time last_checkin_time; |
62 std::set<std::string> last_checkin_accounts; | 62 std::set<std::string> last_checkin_accounts; |
63 AccountMappings account_mappings; | 63 AccountMappings account_mappings; |
64 base::Time last_token_fetch_time; | 64 base::Time last_token_fetch_time; |
65 std::map<std::string, int> heartbeat_intervals; | 65 std::map<std::string, int> heartbeat_intervals; |
66 std::map<std::string, std::string> instance_id_data; | 66 std::map<std::string, std::string> instance_id_data; |
67 }; | 67 }; |
68 | 68 |
69 typedef std::vector<std::string> PersistentIdList; | 69 typedef std::vector<std::string> PersistentIdList; |
70 typedef base::Callback<void(scoped_ptr<LoadResult> result)> LoadCallback; | 70 typedef base::Callback<void(std::unique_ptr<LoadResult> result)> LoadCallback; |
71 typedef base::Callback<void(bool success)> UpdateCallback; | 71 typedef base::Callback<void(bool success)> UpdateCallback; |
72 | 72 |
73 GCMStore(); | 73 GCMStore(); |
74 virtual ~GCMStore(); | 74 virtual ~GCMStore(); |
75 | 75 |
76 // Load the data from persistent store and pass the initial state back to | 76 // Load the data from persistent store and pass the initial state back to |
77 // caller. | 77 // caller. |
78 virtual void Load(StoreOpenMode open_mode, const LoadCallback& callback) = 0; | 78 virtual void Load(StoreOpenMode open_mode, const LoadCallback& callback) = 0; |
79 | 79 |
80 // Close the persistent store. | 80 // Close the persistent store. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 virtual void RemoveInstanceIDData(const std::string& app_id, | 159 virtual void RemoveInstanceIDData(const std::string& app_id, |
160 const UpdateCallback& callback) = 0; | 160 const UpdateCallback& callback) = 0; |
161 | 161 |
162 private: | 162 private: |
163 DISALLOW_COPY_AND_ASSIGN(GCMStore); | 163 DISALLOW_COPY_AND_ASSIGN(GCMStore); |
164 }; | 164 }; |
165 | 165 |
166 } // namespace gcm | 166 } // namespace gcm |
167 | 167 |
168 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_H_ | 168 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_H_ |
OLD | NEW |