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 COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ |
6 #define COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ | 6 #define COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 virtual void UpdateAccountMapping(const AccountMapping& account_mapping) = 0; | 131 virtual void UpdateAccountMapping(const AccountMapping& account_mapping) = 0; |
132 | 132 |
133 // Removes the account mapping information reated to |account_id| from | 133 // Removes the account mapping information reated to |account_id| from |
134 // persistent store. | 134 // persistent store. |
135 virtual void RemoveAccountMapping(const std::string& account_id) = 0; | 135 virtual void RemoveAccountMapping(const std::string& account_id) = 0; |
136 | 136 |
137 // Getter and setter of last token fetch time. | 137 // Getter and setter of last token fetch time. |
138 virtual base::Time GetLastTokenFetchTime() = 0; | 138 virtual base::Time GetLastTokenFetchTime() = 0; |
139 virtual void SetLastTokenFetchTime(const base::Time& time) = 0; | 139 virtual void SetLastTokenFetchTime(const base::Time& time) = 0; |
140 | 140 |
| 141 // Sets whether or not GCM should try to wake the system from suspend in order |
| 142 // to send a heartbeat message. |
| 143 virtual void WakeFromSuspendForHeartbeat(bool wake) = 0; |
| 144 |
141 protected: | 145 protected: |
142 // Ensures that the GCM service starts (if necessary conditions are met). | 146 // Ensures that the GCM service starts (if necessary conditions are met). |
143 virtual GCMClient::Result EnsureStarted() = 0; | 147 virtual GCMClient::Result EnsureStarted() = 0; |
144 | 148 |
145 // Platform-specific implementation of Register. | 149 // Platform-specific implementation of Register. |
146 virtual void RegisterImpl(const std::string& app_id, | 150 virtual void RegisterImpl(const std::string& app_id, |
147 const std::vector<std::string>& sender_ids) = 0; | 151 const std::vector<std::string>& sender_ids) = 0; |
148 | 152 |
149 // Platform-specific implementation of Unregister. | 153 // Platform-specific implementation of Unregister. |
150 virtual void UnregisterImpl(const std::string& app_id) = 0; | 154 virtual void UnregisterImpl(const std::string& app_id) = 0; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 DefaultGCMAppHandler default_app_handler_; | 202 DefaultGCMAppHandler default_app_handler_; |
199 | 203 |
200 base::WeakPtrFactory<GCMDriver> weak_ptr_factory_; | 204 base::WeakPtrFactory<GCMDriver> weak_ptr_factory_; |
201 | 205 |
202 DISALLOW_COPY_AND_ASSIGN(GCMDriver); | 206 DISALLOW_COPY_AND_ASSIGN(GCMDriver); |
203 }; | 207 }; |
204 | 208 |
205 } // namespace gcm | 209 } // namespace gcm |
206 | 210 |
207 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ | 211 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ |
OLD | NEW |