Chromium Code Reviews| Index: third_party/WebKit/Source/modules/background_sync/BackgroundSyncProvider.h |
| diff --git a/third_party/WebKit/Source/modules/background_sync/BackgroundSyncProvider.h b/third_party/WebKit/Source/modules/background_sync/BackgroundSyncProvider.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1915dbaa5ce2694873f57a6424008ae3450f0b14 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/background_sync/BackgroundSyncProvider.h |
| @@ -0,0 +1,56 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
|
haraken
2016/11/05 13:00:19
2016
adithyas
2016/11/07 19:22:55
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef BackgroundSyncProvider_h |
| +#define BackgroundSyncProvider_h |
| + |
| +#include "base/macros.h" |
| +#include "modules/background_sync/SyncCallbacks.h" |
| +#include "public/platform/modules/background_sync/background_sync.mojom-blink.h" |
| +#include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h" |
| +#include <memory> |
| +#include <stdint.h> |
| +#include <string> |
| + |
| +namespace blink { |
| + |
| +// The BackgroundSyncProvider is called by the SyncManager and SyncRegistration |
| +// objects and communicates with the BackgroundSyncManager object in the browser |
| +// process. Each thread will have its own instance (e.g. main thread, worker |
| +// threads), instantiated as needed by SyncManager. Each instance of |
| +// the provider creates a new mojo connection to a new |
| +// BackgroundSyncManagerImpl, which then talks to the BackgroundSyncManager |
| +// object. |
| +class BackgroundSyncProvider { |
| + public: |
| + 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
|
| + |
| + // 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.
|
| + void registerBackgroundSync(mojom::blink::SyncRegistrationPtr& options, |
| + WebServiceWorkerRegistration*, |
| + SyncRegistrationCallbacks*); |
| + void getRegistrations(WebServiceWorkerRegistration*, |
| + SyncGetRegistrationsCallbacks*); |
| + |
| + private: |
| + // Callback handlers |
| + void RegisterCallback(std::unique_ptr<blink::SyncRegistrationCallbacks>, |
| + mojom::blink::BackgroundSyncError, |
| + mojom::blink::SyncRegistrationPtr options); |
| + void GetRegistrationsCallback( |
| + std::unique_ptr<SyncGetRegistrationsCallbacks>, |
| + mojom::blink::BackgroundSyncError, |
| + mojo::WTFArray<mojom::blink::SyncRegistrationPtr> registrations); |
| + |
| + // Helper method that returns an initialized BackgroundSyncServicePtr. |
| + mojom::blink::BackgroundSyncServicePtr& GetBackgroundSyncServicePtr(); |
| + |
| + 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.
|
| + |
| + 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.
|
| +}; |
| + |
| +} // namespace content |
|
jbroman
2016/11/05 22:51:09
namespace blink
adithyas
2016/11/07 19:22:55
Done.
|
| + |
| +#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.
|