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

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

Issue 2762573003: Implement BackgroundFetchManager.fetch() and struct traits (Closed)
Patch Set: First round of comments 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 ad8590e5426a46861dc02bd4cc83f8f8bdeb1e07..c8c10674bad2fd1ed44cbabe35a253e290a96491 100644
--- a/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchBridge.h
+++ b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchBridge.h
@@ -16,6 +16,7 @@
namespace blink {
+class BackgroundFetchOptions;
class BackgroundFetchRegistration;
// The bridge is responsible for establishing and maintaining the Mojo
@@ -29,11 +30,10 @@ class BackgroundFetchBridge final
public:
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 RegistrationCallback = Function<void(mojom::blink::BackgroundFetchError,
+ BackgroundFetchRegistration*)>;
using UpdateUICallback = Function<void(mojom::blink::BackgroundFetchError)>;
static BackgroundFetchBridge* from(ServiceWorkerRegistration*);
@@ -41,7 +41,12 @@ class BackgroundFetchBridge final
virtual ~BackgroundFetchBridge();
- // TODO(peter): Implement support for the `fetch()` function in the bridge.
+ // Creates a new Background Fetch registration identified by |tag| with the
+ // given |options| for the sequence of |requests|. The |callback| will be
+ // invoked when the registration has been created.
+ void fetch(const String& tag,
+ const BackgroundFetchOptions&,
+ std::unique_ptr<RegistrationCallback>);
// Updates the user interface for the Background Fetch identified by |tag|
// with the updated |title|. Will invoke the |callback| when the interface
@@ -59,7 +64,7 @@ class BackgroundFetchBridge final
// |callback| with the Background Fetch registration, which may be a nullptr
// if the |tag| does not exist, when the Mojo call has completed.
void getRegistration(const String& tag,
- std::unique_ptr<GetRegistrationCallback>);
+ std::unique_ptr<RegistrationCallback>);
// Gets the sequence of tags for active Background Fetch registrations. Will
// invoke the |callback| with the tags when the Mojo call has completed.
@@ -72,7 +77,7 @@ class BackgroundFetchBridge final
// established after the first call to this method.
mojom::blink::BackgroundFetchServicePtr& getService();
- void didGetRegistration(std::unique_ptr<GetRegistrationCallback>,
+ void didGetRegistration(std::unique_ptr<RegistrationCallback>,
mojom::blink::BackgroundFetchError,
mojom::blink::BackgroundFetchRegistrationPtr);

Powered by Google App Engine
This is Rietveld 408576698