OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_ |
6 #define CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_ | 6 #define CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
200 void RegisterDidStore(int64 sw_registration_id, | 200 void RegisterDidStore(int64 sw_registration_id, |
201 const BackgroundSyncRegistration& sync_registration, | 201 const BackgroundSyncRegistration& sync_registration, |
202 const StatusAndRegistrationCallback& callback, | 202 const StatusAndRegistrationCallback& callback, |
203 ServiceWorkerStatusCode status); | 203 ServiceWorkerStatusCode status); |
204 | 204 |
205 // Unregister callbacks | 205 // Unregister callbacks |
206 void UnregisterImpl( | 206 void UnregisterImpl( |
207 int64 sw_registration_id, | 207 int64 sw_registration_id, |
208 const RegistrationKey& registration_key, | 208 const RegistrationKey& registration_key, |
209 BackgroundSyncRegistration::RegistrationId sync_registration_id, | 209 BackgroundSyncRegistration::RegistrationId sync_registration_id, |
210 SyncPeriodicity periodicity, | |
210 const StatusCallback& callback); | 211 const StatusCallback& callback); |
211 void UnregisterDidStore( | 212 void UnregisterDidStore(int64 sw_registration_id, |
212 int64 sw_registration_id, | 213 SyncPeriodicity periodicity, |
213 const StatusCallback& callback, | 214 const StatusCallback& callback, |
214 ServiceWorkerStatusCode status); | 215 ServiceWorkerStatusCode status); |
215 | 216 |
216 // GetRegistration callbacks | 217 // GetRegistration callbacks |
217 void GetRegistrationImpl(int64 sw_registration_id, | 218 void GetRegistrationImpl(int64 sw_registration_id, |
218 const RegistrationKey& registration_key, | 219 const RegistrationKey& registration_key, |
219 const StatusAndRegistrationCallback& callback); | 220 const StatusAndRegistrationCallback& callback); |
220 | 221 |
221 // GetRegistrations callbacks | 222 // GetRegistrations callbacks |
222 void GetRegistrationsImpl(int64 sw_registration_id, | 223 void GetRegistrationsImpl(int64 sw_registration_id, |
223 SyncPeriodicity periodicity, | 224 SyncPeriodicity periodicity, |
224 const StatusAndRegistrationsCallback& callback); | 225 const StatusAndRegistrationsCallback& callback); |
225 | 226 |
227 bool WouldFireRegistrationWithOptions( | |
228 const BackgroundSyncRegistrationOptions& options); | |
226 bool IsRegistrationReadyToFire( | 229 bool IsRegistrationReadyToFire( |
227 const BackgroundSyncRegistration& registration); | 230 const BackgroundSyncRegistration& registration); |
228 | 231 |
229 // Schedules pending registrations to run in the future. For one-shots this | 232 // Schedules pending registrations to run in the future. For one-shots this |
230 // means keeping the browser alive so that network connectivity events can be | 233 // means keeping the browser alive so that network connectivity events can be |
231 // seen (on Android the browser is instead woken up the next time it goes | 234 // seen (on Android the browser is instead woken up the next time it goes |
232 // online). For periodic syncs this means creating an alarm. | 235 // online). For periodic syncs this means creating an alarm. |
233 void SchedulePendingRegistrations(); | 236 void SchedulePendingRegistrations(); |
234 | 237 |
235 // FireReadyEvents and callbacks | 238 // FireReadyEvents and callbacks |
(...skipping 18 matching lines...) Expand all Loading... | |
254 void EventCompleteImpl( | 257 void EventCompleteImpl( |
255 int64 service_worker_id, | 258 int64 service_worker_id, |
256 const RegistrationKey& key, | 259 const RegistrationKey& key, |
257 BackgroundSyncRegistration::RegistrationId sync_registration_id, | 260 BackgroundSyncRegistration::RegistrationId sync_registration_id, |
258 ServiceWorkerStatusCode status_code, | 261 ServiceWorkerStatusCode status_code, |
259 const base::Closure& callback); | 262 const base::Closure& callback); |
260 void EventCompleteDidStore(int64 service_worker_id, | 263 void EventCompleteDidStore(int64 service_worker_id, |
261 const base::Closure& callback, | 264 const base::Closure& callback, |
262 ServiceWorkerStatusCode status_code); | 265 ServiceWorkerStatusCode status_code); |
263 | 266 |
267 // Called when all sync events have completed. | |
268 static void OnAllSyncEventsCompleted(const base::TimeTicks& startTime, | |
Alexei Svitkine (slow)
2015/07/09 21:02:57
Nit: hacker_style not camelCase for param names
iclelland
2015/07/10 14:57:26
Done.
| |
269 const base::Closure& callback); | |
270 | |
264 // OnRegistrationDeleted callbacks | 271 // OnRegistrationDeleted callbacks |
265 void OnRegistrationDeletedImpl(int64 registration_id, | 272 void OnRegistrationDeletedImpl(int64 registration_id, |
266 const base::Closure& callback); | 273 const base::Closure& callback); |
267 | 274 |
268 // OnStorageWiped callbacks | 275 // OnStorageWiped callbacks |
269 void OnStorageWipedImpl(const base::Closure& callback); | 276 void OnStorageWipedImpl(const base::Closure& callback); |
270 | 277 |
271 void OnNetworkChanged(); | 278 void OnNetworkChanged(); |
272 void OnPowerChanged(); | 279 void OnPowerChanged(); |
273 | 280 |
(...skipping 18 matching lines...) Expand all Loading... | |
292 scoped_ptr<BackgroundSyncPowerObserver> power_observer_; | 299 scoped_ptr<BackgroundSyncPowerObserver> power_observer_; |
293 | 300 |
294 base::WeakPtrFactory<BackgroundSyncManager> weak_ptr_factory_; | 301 base::WeakPtrFactory<BackgroundSyncManager> weak_ptr_factory_; |
295 | 302 |
296 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncManager); | 303 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncManager); |
297 }; | 304 }; |
298 | 305 |
299 } // namespace content | 306 } // namespace content |
300 | 307 |
301 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_ | 308 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_ |
OLD | NEW |