| 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 <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 | 267 |
| 268 bool AreOptionConditionsMet(const BackgroundSyncRegistrationOptions& options); | 268 bool AreOptionConditionsMet(const BackgroundSyncRegistrationOptions& options); |
| 269 bool IsRegistrationReadyToFire( | 269 bool IsRegistrationReadyToFire( |
| 270 const BackgroundSyncRegistration& registration); | 270 const BackgroundSyncRegistration& registration); |
| 271 | 271 |
| 272 // Schedules pending registrations to run in the future. For one-shots this | 272 // Schedules pending registrations to run in the future. For one-shots this |
| 273 // means keeping the browser alive so that network connectivity events can be | 273 // means keeping the browser alive so that network connectivity events can be |
| 274 // seen (on Android the browser is instead woken up the next time it goes | 274 // seen (on Android the browser is instead woken up the next time it goes |
| 275 // online). For periodic syncs this means creating an alarm. | 275 // online). For periodic syncs this means creating an alarm. |
| 276 void SchedulePendingRegistrations(); | 276 void SchedulePendingRegistrations(); |
| 277 void SchedulePendingRegistrationsOnUIThread( |
| 278 bool keep_browser_alive_for_one_shot); |
| 277 | 279 |
| 278 // FireReadyEvents and callbacks | 280 // FireReadyEvents and callbacks |
| 279 void FireReadyEvents(); | 281 void FireReadyEvents(); |
| 280 void FireReadyEventsImpl(const base::Closure& callback); | 282 void FireReadyEventsImpl(const base::Closure& callback); |
| 281 void FireReadyEventsDidFindRegistration( | 283 void FireReadyEventsDidFindRegistration( |
| 282 const RegistrationKey& registration_key, | 284 const RegistrationKey& registration_key, |
| 283 BackgroundSyncRegistration::RegistrationId registration_id, | 285 BackgroundSyncRegistration::RegistrationId registration_id, |
| 284 const base::Closure& event_fired_callback, | 286 const base::Closure& event_fired_callback, |
| 285 const base::Closure& event_completed_callback, | 287 const base::Closure& event_completed_callback, |
| 286 ServiceWorkerStatusCode service_worker_status, | 288 ServiceWorkerStatusCode service_worker_status, |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 BackgroundSyncRegistrationHandle::HandleId> registration_handle_ids_; | 355 BackgroundSyncRegistrationHandle::HandleId> registration_handle_ids_; |
| 354 | 356 |
| 355 base::WeakPtrFactory<BackgroundSyncManager> weak_ptr_factory_; | 357 base::WeakPtrFactory<BackgroundSyncManager> weak_ptr_factory_; |
| 356 | 358 |
| 357 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncManager); | 359 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncManager); |
| 358 }; | 360 }; |
| 359 | 361 |
| 360 } // namespace content | 362 } // namespace content |
| 361 | 363 |
| 362 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_ | 364 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_ |
| OLD | NEW |