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..5396660b3a010d8aa2ff3c4ffee1524827e2fd95 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,14 @@ 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, |
+ // BACKGRUOND_SYNC_STATE_FAILED on final failure, and |
+ // BACKGROUND_SYNC_STATE_UNREGISTERED if the registration was unregistered |
+ // before it could complete. |
michaeln
2015/09/17 21:44:12
maybe comment about what "done" means in the conte
jkarlin
2015/09/18 12:03:19
Done. Added comment and DCHECK to say that this is
|
+ void NotifyWhenDone(const StatusAndStateCallback& callback); |
+ |
// Returns true if the handle is backed by a BackgroundSyncRegistration in the |
// BackgroundSyncManager. |
bool IsValid() const; |