Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
|
haraken
2016/11/05 13:00:19
2016
adithyas
2016/11/07 19:22:55
Done.
| |
| 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 BackgroundSyncProvider_h | |
| 6 #define BackgroundSyncProvider_h | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "modules/background_sync/SyncCallbacks.h" | |
| 10 #include "public/platform/modules/background_sync/background_sync.mojom-blink.h" | |
| 11 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h" | |
| 12 #include <memory> | |
| 13 #include <stdint.h> | |
| 14 #include <string> | |
| 15 | |
| 16 namespace blink { | |
| 17 | |
| 18 // The BackgroundSyncProvider is called by the SyncManager and SyncRegistration | |
| 19 // objects and communicates with the BackgroundSyncManager object in the browser | |
| 20 // process. Each thread will have its own instance (e.g. main thread, worker | |
| 21 // threads), instantiated as needed by SyncManager. Each instance of | |
| 22 // the provider creates a new mojo connection to a new | |
| 23 // BackgroundSyncManagerImpl, which then talks to the BackgroundSyncManager | |
| 24 // object. | |
| 25 class BackgroundSyncProvider { | |
| 26 public: | |
| 27 explicit BackgroundSyncProvider(){}; | |
|
jbroman
2016/11/05 22:51:09
You can remove this constructor; the default one w
adithyas
2016/11/07 19:22:55
Omitting this line seems to generate a compiler er
| |
| 28 | |
| 29 // blink::WebSyncProvider implementation | |
|
jbroman
2016/11/05 22:51:09
Remove this comment, as blink::WebSyncProvider is
adithyas
2016/11/07 19:22:55
Done.
| |
| 30 void registerBackgroundSync(mojom::blink::SyncRegistrationPtr& options, | |
| 31 WebServiceWorkerRegistration*, | |
| 32 SyncRegistrationCallbacks*); | |
| 33 void getRegistrations(WebServiceWorkerRegistration*, | |
| 34 SyncGetRegistrationsCallbacks*); | |
| 35 | |
| 36 private: | |
| 37 // Callback handlers | |
| 38 void RegisterCallback(std::unique_ptr<blink::SyncRegistrationCallbacks>, | |
| 39 mojom::blink::BackgroundSyncError, | |
| 40 mojom::blink::SyncRegistrationPtr options); | |
| 41 void GetRegistrationsCallback( | |
| 42 std::unique_ptr<SyncGetRegistrationsCallbacks>, | |
| 43 mojom::blink::BackgroundSyncError, | |
| 44 mojo::WTFArray<mojom::blink::SyncRegistrationPtr> registrations); | |
| 45 | |
| 46 // Helper method that returns an initialized BackgroundSyncServicePtr. | |
| 47 mojom::blink::BackgroundSyncServicePtr& GetBackgroundSyncServicePtr(); | |
| 48 | |
| 49 mojom::blink::BackgroundSyncServicePtr backgroundSyncService; | |
|
jbroman
2016/11/05 22:51:09
Data members in blink should be named beginning wi
adithyas
2016/11/07 19:22:55
Done.
| |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncProvider); | |
|
jbroman
2016/11/05 22:51:09
In Blink, use WTF_MAKE_NONCOPYABLE instead of DISA
adithyas
2016/11/07 19:22:55
Done.
| |
| 52 }; | |
| 53 | |
| 54 } // namespace content | |
|
jbroman
2016/11/05 22:51:09
namespace blink
adithyas
2016/11/07 19:22:55
Done.
| |
| 55 | |
| 56 #endif // MODULES_BACKGROUND_SYNC_BACKGROUND_SYNC_PROVIDER_H_ | |
|
jbroman
2016/11/05 22:51:09
BackgroundSyncProvider_h
adithyas
2016/11/07 19:22:55
Done.
| |
| OLD | NEW |