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

Unified Diff: third_party/WebKit/public/platform/modules/background_fetch/background_fetch.mojom

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/public/platform/modules/background_fetch/background_fetch.mojom
diff --git a/third_party/WebKit/public/platform/modules/background_fetch/background_fetch.mojom b/third_party/WebKit/public/platform/modules/background_fetch/background_fetch.mojom
index 381a3c889f31a4bb87c4d0d2f816604d6a653bc6..da50934a03af1d7984c571ba7cbc80057fb508c8 100644
--- a/third_party/WebKit/public/platform/modules/background_fetch/background_fetch.mojom
+++ b/third_party/WebKit/public/platform/modules/background_fetch/background_fetch.mojom
@@ -10,21 +10,42 @@ enum BackgroundFetchError {
INVALID_TAG
};
+// Represents the definition of an icon developers can optionally provide with a
+// Background Fetch fetch. Analogous to the following structure in the spec:
+// https://wicg.github.io/background-fetch/#background-fetch-manager
struct IconDefinition {
string src;
string sizes;
string type;
};
+// Represents the optional options a developer can provide when starting a new
+// Background Fetch fetch. Analogous to the following structure in the spec:
+// https://wicg.github.io/background-fetch/#background-fetch-manager
+struct BackgroundFetchOptions {
+ array<IconDefinition> icons;
+ int64 total_download_size;
+ string title;
+};
+
+// Represents the information associated with a Background Fetch registration.
+// Analogous to the following structure in the spec:
+// https://wicg.github.io/background-fetch/#background-fetch-registration
struct BackgroundFetchRegistration {
string tag;
array<IconDefinition> icons;
- int64 total_download_size = 0;
- string title = "";
+ int64 total_download_size;
+ string title;
};
interface BackgroundFetchService {
- // TODO(peter): Implement support for the `fetch()` function in Mojo.
+ // Creates a new Background Fetch registration identified by |tag| with the
+ // given |options| for the sequence of |requests|.
+ Fetch(int64 service_worker_registration_id,
+ string tag,
+ BackgroundFetchOptions options)
+ => (BackgroundFetchError error,
+ BackgroundFetchRegistration? registration);
// Updates the user interface for the Background Fetch identified by the
// |service_worker_registration_id| and the |tag|.

Powered by Google App Engine
This is Rietveld 408576698