| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 typedef base::Callback<void(scoped_ptr<LoadResult> result)> LoadCallback; | 61 typedef base::Callback<void(scoped_ptr<LoadResult> result)> LoadCallback; |
| 62 typedef base::Callback<void(bool success)> UpdateCallback; | 62 typedef base::Callback<void(bool success)> UpdateCallback; |
| 63 | 63 |
| 64 GCMStore(); | 64 GCMStore(); |
| 65 virtual ~GCMStore(); | 65 virtual ~GCMStore(); |
| 66 | 66 |
| 67 // Load the data from persistent store and pass the initial state back to | 67 // Load the data from persistent store and pass the initial state back to |
| 68 // caller. | 68 // caller. |
| 69 virtual void Load(const LoadCallback& callback) = 0; | 69 virtual void Load(const LoadCallback& callback) = 0; |
| 70 | 70 |
| 71 // Close the persistent store. |
| 72 virtual void Close() = 0; |
| 73 |
| 71 // Clears the GCM store of all data. | 74 // Clears the GCM store of all data. |
| 72 virtual void Destroy(const UpdateCallback& callback) = 0; | 75 virtual void Destroy(const UpdateCallback& callback) = 0; |
| 73 | 76 |
| 74 // Sets this device's messaging credentials. | 77 // Sets this device's messaging credentials. |
| 75 virtual void SetDeviceCredentials(uint64 device_android_id, | 78 virtual void SetDeviceCredentials(uint64 device_android_id, |
| 76 uint64 device_security_token, | 79 uint64 device_security_token, |
| 77 const UpdateCallback& callback) = 0; | 80 const UpdateCallback& callback) = 0; |
| 78 | 81 |
| 79 // Unacknowledged incoming message handling. | 82 // Unacknowledged incoming message handling. |
| 80 virtual void AddIncomingMessage(const std::string& persistent_id, | 83 virtual void AddIncomingMessage(const std::string& persistent_id, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 108 virtual void RemoveUserSerialNumber(const std::string& username, | 111 virtual void RemoveUserSerialNumber(const std::string& username, |
| 109 const UpdateCallback& callback) = 0; | 112 const UpdateCallback& callback) = 0; |
| 110 | 113 |
| 111 private: | 114 private: |
| 112 DISALLOW_COPY_AND_ASSIGN(GCMStore); | 115 DISALLOW_COPY_AND_ASSIGN(GCMStore); |
| 113 }; | 116 }; |
| 114 | 117 |
| 115 } // namespace gcm | 118 } // namespace gcm |
| 116 | 119 |
| 117 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_H_ | 120 #endif // GOOGLE_APIS_GCM_ENGINE_GCM_STORE_H_ |
| OLD | NEW |