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

Unified Diff: third_party/WebKit/Source/modules/background_fetch/BackgroundFetchBridge.h

Issue 2762663002: BackgroundFetchRegistration.abort() should return a Promise. (Closed)
Patch Set: Created 3 years, 9 months 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_fetch/BackgroundFetchBridge.h
diff --git a/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchBridge.h b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchBridge.h
index 837237db8186649bc8514df41ecf678432d3bb5f..ad8590e5426a46861dc02bd4cc83f8f8bdeb1e07 100644
--- a/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchBridge.h
+++ b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchBridge.h
@@ -28,12 +28,13 @@ class BackgroundFetchBridge final
WTF_MAKE_NONCOPYABLE(BackgroundFetchBridge);
public:
- using UpdateUICallback = Function<void(mojom::blink::BackgroundFetchError)>;
+ using AbortCallback = Function<void(mojom::blink::BackgroundFetchError)>;
using GetRegistrationCallback =
Function<void(mojom::blink::BackgroundFetchError,
BackgroundFetchRegistration*)>;
using GetTagsCallback =
Function<void(mojom::blink::BackgroundFetchError, const Vector<String>&)>;
+ using UpdateUICallback = Function<void(mojom::blink::BackgroundFetchError)>;
static BackgroundFetchBridge* from(ServiceWorkerRegistration*);
static const char* supplementName();
@@ -49,8 +50,10 @@ class BackgroundFetchBridge final
const String& title,
std::unique_ptr<UpdateUICallback>);
- // Aborts the active Background Fetch for |tag|. Does not respond.
- void abort(const String& tag);
+ // Aborts the active Background Fetch for |tag|. Will invoke the |callback|
+ // when the Background Fetch identified by |tag| has been aborted, or could
+ // not be aborted for operational reasons.
+ void abort(const String& tag, std::unique_ptr<AbortCallback>);
// Gets the Background Fetch registration for the given |tag|. Will invoke the
// |callback| with the Background Fetch registration, which may be a nullptr

Powered by Google App Engine
This is Rietveld 408576698