OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_BACKGROUND_SYNC_CLIENT_BACKGROUND_SYNC_REGISTRATION_H_ |
| 6 #define CONTENT_BROWSER_BACKGROUND_SYNC_CLIENT_BACKGROUND_SYNC_REGISTRATION_H_ |
| 7 |
| 8 #include "base/callback.h" |
| 9 #include "content/browser/background_sync/background_sync_registration.h" |
| 10 #include "content/browser/background_sync/background_sync_status.h" |
| 11 #include "content/common/content_export.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 class BackgroundSyncManager; |
| 16 |
| 17 // BackgroundSyncRegistrations that are exposed to clients. They call |
| 18 // ReleaseRegistration on deletion and provide access to Unregister. |
| 19 // ClientBackgroundSyncRegistration objects must be deleted before the |
| 20 // BackgroundSyncManager is deleted. |
| 21 class CONTENT_EXPORT ClientBackgroundSyncRegistration |
| 22 : public BackgroundSyncRegistration { |
| 23 public: |
| 24 using StatusCallback = base::Callback<void(BackgroundSyncStatus)>; |
| 25 |
| 26 explicit ClientBackgroundSyncRegistration( |
| 27 BackgroundSyncManager* background_sync_manager); |
| 28 ~ClientBackgroundSyncRegistration() override; |
| 29 |
| 30 void Unregister(int64 service_worker_id, const StatusCallback& callback); |
| 31 |
| 32 private: |
| 33 // This object must be deleted before the BackgroundSyncManager |
| 34 // is deleted. |
| 35 BackgroundSyncManager* background_sync_manager_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(ClientBackgroundSyncRegistration); |
| 38 }; |
| 39 |
| 40 } // namespace |
| 41 |
| 42 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_CLIENT_BACKGROUND_SYNC_REGISTRATION_H
_ |
OLD | NEW |