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 // Unregisters the background sync registration. Calls |callback| | |
31 // with BACKGROUND_SYNC_STATUS_OK on success. | |
iclelland
2015/08/17 19:22:02
And never, ever fails ;)
(I don't know if we need
jkarlin
2015/08/18 15:12:38
:) Changed to "if it succeeds".
| |
32 void Unregister(int64 service_worker_id, const StatusCallback& callback); | |
33 | |
34 bool IsValid() const override; | |
35 | |
36 private: | |
37 // This object must be deleted before the BackgroundSyncManager | |
38 // is deleted. | |
39 BackgroundSyncManager* background_sync_manager_; | |
40 | |
41 DISALLOW_COPY_AND_ASSIGN(ClientBackgroundSyncRegistration); | |
42 }; | |
43 | |
44 } // namespace | |
45 | |
46 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_CLIENT_BACKGROUND_SYNC_REGISTRATION_H _ | |
OLD | NEW |