Index: content/browser/background_sync/background_sync_registration_handle.h |
diff --git a/content/browser/background_sync/background_sync_registration_handle.h b/content/browser/background_sync/background_sync_registration_handle.h |
index 564bd584dc6dc6946696d8ff256ff4bae79a471a..bf35ac088f5d6deb0bd2a4d49917968d88a2cf10 100644 |
--- a/content/browser/background_sync/background_sync_registration_handle.h |
+++ b/content/browser/background_sync/background_sync_registration_handle.h |
@@ -10,6 +10,7 @@ |
#include "base/memory/weak_ptr.h" |
#include "content/browser/background_sync/background_sync_registration.h" |
#include "content/browser/background_sync/background_sync_status.h" |
+#include "content/common/background_sync_service.mojom.h" |
#include "content/common/content_export.h" |
namespace content { |
@@ -25,6 +26,8 @@ class CONTENT_EXPORT BackgroundSyncRegistrationHandle { |
public: |
using HandleId = int; |
using StatusCallback = base::Callback<void(BackgroundSyncStatus)>; |
+ using StatusAndStateCallback = |
+ base::Callback<void(BackgroundSyncStatus, BackgroundSyncState)>; |
~BackgroundSyncRegistrationHandle(); |
@@ -42,6 +45,13 @@ class CONTENT_EXPORT BackgroundSyncRegistrationHandle { |
// with BACKGROUND_SYNC_STATUS_OK if it succeeds. |
void Unregister(int64_t service_worker_id, const StatusCallback& callback); |
+ // Runs |callback| when the registration associated with |handle_id| |
+ // completes.The provided status is BACKGROUND_SYNC_STATUS_OK if the operation |
+ // succeeded. The provided state is BACKGROUND_SYNC_STATE_SUCCESS on success, |
+ // *_STATE_FAILED on final failure, and *_STATE_UNREGISTERED if the |
iclelland
2015/09/17 13:48:09
Is * just 'tired of typing', or does it match some
jkarlin
2015/09/17 17:40:25
Done.
|
+ // registration was unregistered before it could complete. |
+ void NotifyWhenDone(const StatusAndStateCallback& callback); |
+ |
// Returns true if the handle is backed by a BackgroundSyncRegistration in the |
// BackgroundSyncManager. |
bool IsValid() const; |