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

Side by Side Diff: third_party/WebKit/public/platform/modules/background_fetch/background_fetch.mojom

Issue 2762573003: Implement BackgroundFetchManager.fetch() and struct traits (Closed)
Patch Set: Add a missing file 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 module blink.mojom; 5 module blink.mojom;
6 6
7 enum BackgroundFetchError { 7 enum BackgroundFetchError {
8 NONE, 8 NONE,
9 DUPLICATED_TAG 9 DUPLICATED_TAG
10 }; 10 };
11 11
12 struct IconDefinition { 12 struct IconDefinition {
dcheng 2017/03/21 07:03:20 It would be nice to point at the spec definition f
Peter Beverloo 2017/03/21 13:46:27 I've added links to their specifications. The link
13 string src; 13 string src;
14 string sizes; 14 string sizes;
15 string type; 15 string type;
16 }; 16 };
17 17
18 struct BackgroundFetchOptions {
19 array<IconDefinition> icons;
20 int64 total_download_size;
21 string title;
22 };
23
18 struct BackgroundFetchRegistration { 24 struct BackgroundFetchRegistration {
19 string tag; 25 string tag;
20 array<IconDefinition> icons; 26 array<IconDefinition> icons;
21 int64 total_download_size = 0; 27 int64 total_download_size;
22 string title = ""; 28 string title;
23 }; 29 };
24 30
25 interface BackgroundFetchService { 31 interface BackgroundFetchService {
26 // TODO(peter): Implement support for the `fetch()` function in Mojo. 32 // Creates a new Background Fetch registration identified by |tag| with the
33 // given |options| for the sequence of |requests|.
34 Fetch(int64 service_worker_registration_id,
35 string tag,
36 BackgroundFetchOptions options)
37 => (BackgroundFetchError error,
38 BackgroundFetchRegistration? registration);
27 39
28 // Updates the user interface for the Background Fetch identified by the 40 // Updates the user interface for the Background Fetch identified by the
29 // |service_worker_registration_id| and the |tag|. 41 // |service_worker_registration_id| and the |tag|.
30 UpdateUI(int64 service_worker_registration_id, string tag, string title) 42 UpdateUI(int64 service_worker_registration_id, string tag, string title)
31 => (BackgroundFetchError error); 43 => (BackgroundFetchError error);
32 44
33 // Aborts the Background Fetch registration identified by the 45 // Aborts the Background Fetch registration identified by the
34 // |service_worker_registration_id| and the |tag|. 46 // |service_worker_registration_id| and the |tag|.
35 Abort(int64 service_worker_registration_id, string tag); 47 Abort(int64 service_worker_registration_id, string tag);
36 48
37 // Gets the Background Fetch registration identified by the 49 // Gets the Background Fetch registration identified by the
38 // |service_worker_registration_id| and the |tag|. 50 // |service_worker_registration_id| and the |tag|.
39 GetRegistration(int64 service_worker_registration_id, string tag) 51 GetRegistration(int64 service_worker_registration_id, string tag)
40 => (BackgroundFetchError error, 52 => (BackgroundFetchError error,
41 BackgroundFetchRegistration? registration); 53 BackgroundFetchRegistration? registration);
42 54
43 // Gets the sequence of tags for active Background Fetch registrations given 55 // Gets the sequence of tags for active Background Fetch registrations given
44 // the |service_worker_registration_id|. 56 // the |service_worker_registration_id|.
45 GetTags(int64 service_worker_registration_id) 57 GetTags(int64 service_worker_registration_id)
46 => (BackgroundFetchError error, 58 => (BackgroundFetchError error,
47 array<string> tags); 59 array<string> tags);
48 }; 60 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698