Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(704)

Unified Diff: third_party/WebKit/Source/modules/background_sync/SyncManager.h

Issue 2515353002: [background-sync] Merge SyncManager and BackgroundSyncProvider (Closed)
Patch Set: Reorder methods Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/background_sync/SyncManager.h
diff --git a/third_party/WebKit/Source/modules/background_sync/SyncManager.h b/third_party/WebKit/Source/modules/background_sync/SyncManager.h
index 22b3fbbe8190473dae4d73a49f740a8f45402a28..accbe2d235ee577b7e740cefd33da37fcdc51803 100644
--- a/third_party/WebKit/Source/modules/background_sync/SyncManager.h
+++ b/third_party/WebKit/Source/modules/background_sync/SyncManager.h
@@ -7,17 +7,18 @@
#include "bindings/core/v8/ScriptWrappable.h"
#include "platform/heap/Handle.h"
+#include "public/platform/modules/background_sync/background_sync.mojom-blink.h"
#include "wtf/text/WTFString.h"
namespace blink {
-class BackgroundSyncProvider;
class ExecutionContext;
class ScriptPromise;
+class ScriptPromiseResolver;
class ScriptState;
class ServiceWorkerRegistration;
-class SyncManager final : public GarbageCollected<SyncManager>,
+class SyncManager final : public GarbageCollectedFinalized<SyncManager>,
public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
@@ -36,9 +37,22 @@ class SyncManager final : public GarbageCollected<SyncManager>,
private:
explicit SyncManager(ServiceWorkerRegistration*);
- static BackgroundSyncProvider* backgroundSyncProvider();
+ // Returns an initialized BackgroundSyncServicePtr. A connection with the
+ // the browser's BackgroundSyncService is created the first time this method
+ // is called.
+ const mojom::blink::BackgroundSyncServicePtr& getBackgroundSyncServicePtr();
+
+ // Callbacks
+ static void registerCallback(ScriptPromiseResolver*,
+ mojom::blink::BackgroundSyncError,
+ mojom::blink::SyncRegistrationPtr options);
+ static void getRegistrationsCallback(
+ ScriptPromiseResolver*,
+ mojom::blink::BackgroundSyncError,
+ mojo::WTFArray<mojom::blink::SyncRegistrationPtr> registrations);
Member<ServiceWorkerRegistration> m_registration;
+ mojom::blink::BackgroundSyncServicePtr m_backgroundSyncService;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698