Index: content/browser/background_sync/client_background_sync_registration.h |
diff --git a/content/browser/background_sync/client_background_sync_registration.h b/content/browser/background_sync/client_background_sync_registration.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f0f8a8fc41e00cd42b90af784ab9bf009494e55b |
--- /dev/null |
+++ b/content/browser/background_sync/client_background_sync_registration.h |
@@ -0,0 +1,42 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_BROWSER_BACKGROUND_SYNC_CLIENT_BACKGROUND_SYNC_REGISTRATION_H_ |
+#define CONTENT_BROWSER_BACKGROUND_SYNC_CLIENT_BACKGROUND_SYNC_REGISTRATION_H_ |
+ |
+#include "base/callback.h" |
+#include "content/browser/background_sync/background_sync_registration.h" |
+#include "content/browser/background_sync/background_sync_status.h" |
+#include "content/common/content_export.h" |
+ |
+namespace content { |
+ |
+class BackgroundSyncManager; |
+ |
+// BackgroundSyncRegistrations that are exposed to clients. They call |
+// ReleaseRegistration on deletion and provide access to Unregister. |
+// ClientBackgroundSyncRegistration objects must be deleted before the |
+// BackgroundSyncManager is deleted. |
+class CONTENT_EXPORT ClientBackgroundSyncRegistration |
+ : public BackgroundSyncRegistration { |
+ public: |
+ using StatusCallback = base::Callback<void(BackgroundSyncStatus)>; |
+ |
+ explicit ClientBackgroundSyncRegistration( |
+ BackgroundSyncManager* background_sync_manager); |
+ ~ClientBackgroundSyncRegistration() override; |
+ |
+ void Unregister(int64 service_worker_id, const StatusCallback& callback); |
+ |
+ private: |
+ // This object must be deleted before the BackgroundSyncManager |
+ // is deleted. |
+ BackgroundSyncManager* background_sync_manager_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ClientBackgroundSyncRegistration); |
+}; |
+ |
+} // namespace |
+ |
+#endif // CONTENT_BROWSER_BACKGROUND_SYNC_CLIENT_BACKGROUND_SYNC_REGISTRATION_H_ |