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

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

Issue 2481393002: [background-sync] Remove WebSyncError and SyncCallbacks (Closed)
Patch Set: Rebase 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/BackgroundSyncProvider.h
diff --git a/third_party/WebKit/Source/modules/background_sync/BackgroundSyncProvider.h b/third_party/WebKit/Source/modules/background_sync/BackgroundSyncProvider.h
index af633217d1cf1a053375f3677dd977afc007880c..e3fa70b282d1cfe70cab07313d2ee303223fe223 100644
--- a/third_party/WebKit/Source/modules/background_sync/BackgroundSyncProvider.h
+++ b/third_party/WebKit/Source/modules/background_sync/BackgroundSyncProvider.h
@@ -5,7 +5,6 @@
#ifndef BackgroundSyncProvider_h
#define BackgroundSyncProvider_h
-#include "modules/background_sync/SyncCallbacks.h"
#include "public/platform/modules/background_sync/background_sync.mojom-blink.h"
#include "wtf/Noncopyable.h"
#include <memory>
jbroman 2016/11/18 16:53:32 super-nit: I think this include was here for uniqu
adithyas 2016/11/18 20:05:00 Done.
@@ -13,6 +12,8 @@
namespace blink {
class WebServiceWorkerRegistration;
+class ScriptPromiseResolver;
jbroman 2016/11/18 16:53:31 nit: alphabetize these
adithyas 2016/11/18 20:05:00 Done.
+class SyncError;
// The BackgroundSyncProvider is called by the SyncManager and SyncRegistration
// objects and communicates with the BackgroundSyncManager object in the browser
@@ -28,21 +29,28 @@ class BackgroundSyncProvider {
void registerBackgroundSync(mojom::blink::SyncRegistrationPtr options,
WebServiceWorkerRegistration*,
- std::unique_ptr<SyncRegistrationCallbacks>);
- void getRegistrations(WebServiceWorkerRegistration*,
- std::unique_ptr<SyncGetRegistrationsCallbacks>);
+ ScriptPromiseResolver*);
jbroman 2016/11/18 16:53:32 Since there's only the one implementation of Sync*
adithyas 2016/11/18 20:05:00 Yup I definitely agree with that thought, both cla
iclelland 2016/11/18 20:53:46 The difference, I believe, is that there can be mu
jbroman 2016/11/19 03:32:15 Right, that's the difference (unless there's a cor
haraken 2016/11/21 00:21:58 +1
+ void getRegistrations(WebServiceWorkerRegistration*, ScriptPromiseResolver*);
private:
// Callback handlers
- static void registerCallback(
- std::unique_ptr<blink::SyncRegistrationCallbacks>,
- mojom::blink::BackgroundSyncError,
- mojom::blink::SyncRegistrationPtr options);
+ static void registerCallback(ScriptPromiseResolver*,
+ mojom::blink::BackgroundSyncError,
+ mojom::blink::SyncRegistrationPtr options);
static void getRegistrationsCallback(
- std::unique_ptr<SyncGetRegistrationsCallbacks>,
+ ScriptPromiseResolver*,
mojom::blink::BackgroundSyncError,
mojo::WTFArray<mojom::blink::SyncRegistrationPtr> registrations);
+ // Success and error handlers
+ static void onRegisterSuccess(ScriptPromiseResolver*,
+ mojom::blink::SyncRegistrationPtr);
+ static void onRegisterError(ScriptPromiseResolver*, const SyncError&);
+ static void onGetRegistrationsSuccess(
+ ScriptPromiseResolver*,
+ const Vector<mojom::blink::SyncRegistrationPtr>&);
+ static void onGetRegistrationsError(ScriptPromiseResolver*, const SyncError&);
+
// Returns an initialized BackgroundSyncServicePtr. A connection with the
// the browser's BackgroundSyncService is created the first time this method
// is called.

Powered by Google App Engine
This is Rietveld 408576698