| 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 <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 AccountMappings account_mappings; | 57 AccountMappings account_mappings; |
| 58 base::Time last_token_fetch_time; |
| 58 }; | 59 }; |
| 59 | 60 |
| 60 typedef std::vector<std::string> PersistentIdList; | 61 typedef std::vector<std::string> PersistentIdList; |
| 61 typedef base::Callback<void(scoped_ptr<LoadResult> result)> LoadCallback; | 62 typedef base::Callback<void(scoped_ptr<LoadResult> result)> LoadCallback; |
| 62 typedef base::Callback<void(bool success)> UpdateCallback; | 63 typedef base::Callback<void(bool success)> UpdateCallback; |
| 63 | 64 |
| 64 GCMStore(); | 65 GCMStore(); |
| 65 virtual ~GCMStore(); | 66 virtual ~GCMStore(); |
| 66 | 67 |
| 67 // Load the data from persistent store and pass the initial state back to | 68 // Load the data from persistent store and pass the initial state back to |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 const std::map<std::string, std::string>& settings, | 122 const std::map<std::string, std::string>& settings, |
| 122 const std::string& settings_digest, | 123 const std::string& settings_digest, |
| 123 const UpdateCallback& callback) = 0; | 124 const UpdateCallback& callback) = 0; |
| 124 | 125 |
| 125 // Sets the account information related to device to account mapping. | 126 // Sets the account information related to device to account mapping. |
| 126 virtual void AddAccountMapping(const AccountMapping& account_mapping, | 127 virtual void AddAccountMapping(const AccountMapping& account_mapping, |
| 127 const UpdateCallback& callback) = 0; | 128 const UpdateCallback& callback) = 0; |
| 128 virtual void RemoveAccountMapping(const std::string& account_id, | 129 virtual void RemoveAccountMapping(const std::string& account_id, |
| 129 const UpdateCallback& callback) = 0; | 130 const UpdateCallback& callback) = 0; |
| 130 | 131 |
| 132 // Sets last token fetch time. |
| 133 virtual void SetLastTokenFetchTime(const base::Time& time, |
| 134 const UpdateCallback& callback) = 0; |
| 135 |
| 131 private: | 136 private: |
| 132 DISALLOW_COPY_AND_ASSIGN(GCMStore); | 137 DISALLOW_COPY_AND_ASSIGN(GCMStore); |
| 133 }; | 138 }; |
| 134 | 139 |
| 135 } // namespace gcm | 140 } // namespace gcm |
| 136 | 141 |
| 137 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_H_ | 142 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_H_ |
| OLD | NEW |