| 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 <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 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; | |
| 53 base::Time last_checkin_time; | 51 base::Time last_checkin_time; |
| 54 }; | 52 }; |
| 55 | 53 |
| 56 typedef std::vector<std::string> PersistentIdList; | 54 typedef std::vector<std::string> PersistentIdList; |
| 57 typedef base::Callback<void(scoped_ptr<LoadResult> result)> LoadCallback; | 55 typedef base::Callback<void(scoped_ptr<LoadResult> result)> LoadCallback; |
| 58 typedef base::Callback<void(bool success)> UpdateCallback; | 56 typedef base::Callback<void(bool success)> UpdateCallback; |
| 59 | 57 |
| 60 GCMStore(); | 58 GCMStore(); |
| 61 virtual ~GCMStore(); | 59 virtual ~GCMStore(); |
| 62 | 60 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 const UpdateCallback& callback) = 0; | 100 const UpdateCallback& callback) = 0; |
| 103 virtual void RemoveOutgoingMessage(const std::string& persistent_id, | 101 virtual void RemoveOutgoingMessage(const std::string& persistent_id, |
| 104 const UpdateCallback& callback) = 0; | 102 const UpdateCallback& callback) = 0; |
| 105 virtual void RemoveOutgoingMessages(const PersistentIdList& persistent_ids, | 103 virtual void RemoveOutgoingMessages(const PersistentIdList& persistent_ids, |
| 106 const UpdateCallback& callback) = 0; | 104 const UpdateCallback& callback) = 0; |
| 107 | 105 |
| 108 // Sets last device's checkin time. | 106 // Sets last device's checkin time. |
| 109 virtual void SetLastCheckinTime(const base::Time& last_checkin_time, | 107 virtual void SetLastCheckinTime(const base::Time& last_checkin_time, |
| 110 const UpdateCallback& callback) = 0; | 108 const UpdateCallback& callback) = 0; |
| 111 | 109 |
| 112 // G-service settings handling. | |
| 113 // Persists |settings| and |settings_digest|. It completely replaces the | |
| 114 // 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 | |
| 120 private: | 110 private: |
| 121 DISALLOW_COPY_AND_ASSIGN(GCMStore); | 111 DISALLOW_COPY_AND_ASSIGN(GCMStore); |
| 122 }; | 112 }; |
| 123 | 113 |
| 124 } // namespace gcm | 114 } // namespace gcm |
| 125 | 115 |
| 126 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_H_ | 116 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_H_ |
| OLD | NEW |