Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Unified Diff: content/browser/background_sync/background_sync_manager.h

Issue 1344843003: [BackgroundSync] Add browser side support for SyncRegistration.done (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ncn_max
Patch Set: Address comments from PS7 Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/background_sync/background_sync_manager.h
diff --git a/content/browser/background_sync/background_sync_manager.h b/content/browser/background_sync/background_sync_manager.h
index 673f41f98cb1f2733d7f767964063a048e875f5c..285f68b43776ff32b983a181c905f88e44415183 100644
--- a/content/browser/background_sync/background_sync_manager.h
+++ b/content/browser/background_sync/background_sync_manager.h
@@ -21,6 +21,7 @@
#include "content/browser/cache_storage/cache_storage_scheduler.h"
#include "content/browser/service_worker/service_worker_context_observer.h"
#include "content/browser/service_worker/service_worker_storage.h"
+#include "content/common/background_sync_service.mojom.h"
#include "content/common/content_export.h"
#include "content/common/service_worker/service_worker_status_code.h"
#include "url/gurl.h"
@@ -53,6 +54,8 @@ class CONTENT_EXPORT BackgroundSyncManager
using StatusAndRegistrationCallback =
base::Callback<void(BackgroundSyncStatus,
scoped_ptr<BackgroundSyncRegistrationHandle>)>;
+ using StatusAndStateCallback =
+ base::Callback<void(BackgroundSyncStatus, BackgroundSyncState)>;
using StatusAndRegistrationsCallback = base::Callback<void(
BackgroundSyncStatus,
scoped_ptr<ScopedVector<BackgroundSyncRegistrationHandle>>)>;
@@ -242,6 +245,17 @@ class CONTENT_EXPORT BackgroundSyncManager
const StatusCallback& callback,
ServiceWorkerStatusCode status);
+ // NotifyWhenDone and its callbacks. See
+ // BackgroundSyncRegistrationHandle::NotifyWhenDone for detailed
+ // documentation.
+ void NotifyWhenDone(BackgroundSyncRegistrationHandle::HandleId handle_id,
+ const StatusAndStateCallback& callback);
+ void NotifyWhenDoneImpl(
+ scoped_ptr<BackgroundSyncRegistrationHandle> registration_handle,
+ const StatusAndStateCallback& callback);
+ void NotifyWhenDoneDidFinish(const StatusAndStateCallback& callback,
+ BackgroundSyncState status);
+
// GetRegistration callbacks
void GetRegistrationImpl(int64 sw_registration_id,
const RegistrationKey& registration_key,

Powered by Google App Engine
This is Rietveld 408576698