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

Side by Side Diff: content/common/service_worker/service_worker_event_dispatcher.mojom

Issue 2767093004: Implement the BackgroundFetch{Fail,ed} Service Worker events (Closed)
Patch Set: forward declare the data view 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 content.mojom; 5 module content.mojom;
6 6
7 import "components/payments/content/payment_app.mojom"; 7 import "components/payments/content/payment_app.mojom";
8 import "content/common/url_loader.mojom"; 8 import "content/common/url_loader.mojom";
9 import "mojo/common/string16.mojom"; 9 import "mojo/common/string16.mojom";
10 import "mojo/common/time.mojom"; 10 import "mojo/common/time.mojom";
11 import "third_party/WebKit/public/platform/modules/background_sync/background_sy nc.mojom"; 11 import "third_party/WebKit/public/platform/modules/background_sync/background_sy nc.mojom";
12 import "third_party/WebKit/public/platform/modules/serviceworker/service_worker_ event_status.mojom"; 12 import "third_party/WebKit/public/platform/modules/serviceworker/service_worker_ event_status.mojom";
13 import "url/mojo/origin.mojom"; 13 import "url/mojo/origin.mojom";
14 14
15 [Native] 15 [Native]
16 struct PlatformNotificationData; 16 struct PlatformNotificationData;
17 17
18 [Native] 18 [Native]
19 struct PushEventPayload; 19 struct PushEventPayload;
20 20
21 [Native] 21 [Native]
22 struct ServiceWorkerFetchRequest; 22 struct ServiceWorkerFetchRequest;
23 23
24 [Native] 24 [Native]
25 struct ServiceWorkerResponse;
26
27 [Native]
25 struct ExtendableMessageEventSource; 28 struct ExtendableMessageEventSource;
26 29
30 // TODO(peter): Move this to Blink when both ServiceWorkerFetchRequest and
31 // ServiceWorkerResponse have Mojo counterparts.
32 struct BackgroundFetchSettledFetch {
33 ServiceWorkerFetchRequest request;
34 ServiceWorkerResponse response;
35 };
36
27 enum BackgroundFetchState { 37 enum BackgroundFetchState {
28 PENDING, 38 PENDING,
29 SUCCEEDED, 39 SUCCEEDED,
30 FAILED 40 FAILED
31 }; 41 };
32 42
33 struct FetchEventPreloadHandle { 43 struct FetchEventPreloadHandle {
34 URLLoader url_loader; 44 URLLoader url_loader;
35 URLLoaderClient& url_loader_client_request; 45 URLLoaderClient& url_loader_client_request;
36 }; 46 };
(...skipping 10 matching lines...) Expand all
47 interface ServiceWorkerEventDispatcher { 57 interface ServiceWorkerEventDispatcher {
48 DispatchActivateEvent() 58 DispatchActivateEvent()
49 => (blink.mojom.ServiceWorkerEventStatus status, 59 => (blink.mojom.ServiceWorkerEventStatus status,
50 mojo.common.mojom.Time dispatch_event_time); 60 mojo.common.mojom.Time dispatch_event_time);
51 DispatchBackgroundFetchAbortEvent(string tag) 61 DispatchBackgroundFetchAbortEvent(string tag)
52 => (blink.mojom.ServiceWorkerEventStatus status, 62 => (blink.mojom.ServiceWorkerEventStatus status,
53 mojo.common.mojom.Time dispatch_event_time); 63 mojo.common.mojom.Time dispatch_event_time);
54 DispatchBackgroundFetchClickEvent(string tag, BackgroundFetchState state) 64 DispatchBackgroundFetchClickEvent(string tag, BackgroundFetchState state)
55 => (blink.mojom.ServiceWorkerEventStatus status, 65 => (blink.mojom.ServiceWorkerEventStatus status,
56 mojo.common.mojom.Time dispatch_event_time); 66 mojo.common.mojom.Time dispatch_event_time);
67 DispatchBackgroundFetchFailEvent(string tag,
68 array<BackgroundFetchSettledFetch> fetches)
69 => (blink.mojom.ServiceWorkerEventStatus status,
70 mojo.common.mojom.Time dispatch_event_time);
71 DispatchBackgroundFetchedEvent(string tag,
72 array<BackgroundFetchSettledFetch> fetches)
73 => (blink.mojom.ServiceWorkerEventStatus status,
74 mojo.common.mojom.Time dispatch_event_time);
57 // |fetch_event_id| is used internally when sending the response back to the 75 // |fetch_event_id| is used internally when sending the response back to the
58 // browser process. 76 // browser process.
59 DispatchFetchEvent(int32 fetch_event_id, ServiceWorkerFetchRequest request, 77 DispatchFetchEvent(int32 fetch_event_id, ServiceWorkerFetchRequest request,
60 FetchEventPreloadHandle? preload_handle) 78 FetchEventPreloadHandle? preload_handle)
61 => (blink.mojom.ServiceWorkerEventStatus status, 79 => (blink.mojom.ServiceWorkerEventStatus status,
62 mojo.common.mojom.Time dispatch_event_time); 80 mojo.common.mojom.Time dispatch_event_time);
63 DispatchNotificationClickEvent(string notification_id, 81 DispatchNotificationClickEvent(string notification_id,
64 PlatformNotificationData notification_data, 82 PlatformNotificationData notification_data,
65 int32 action_index, 83 int32 action_index,
66 mojo.common.mojom.String16? reply) 84 mojo.common.mojom.String16? reply)
(...skipping 18 matching lines...) Expand all
85 DispatchExtendableMessageEvent(ExtendableMessageEvent event) 103 DispatchExtendableMessageEvent(ExtendableMessageEvent event)
86 => (blink.mojom.ServiceWorkerEventStatus status, 104 => (blink.mojom.ServiceWorkerEventStatus status,
87 mojo.common.mojom.Time dispatch_event_time); 105 mojo.common.mojom.Time dispatch_event_time);
88 106
89 // Pings the service worker to check if it is responsive. If the callback is 107 // Pings the service worker to check if it is responsive. If the callback is
90 // not called within a certain period of time, the browser will terminate the 108 // not called within a certain period of time, the browser will terminate the
91 // worker. Unlike the other functions in this interface, Ping() does not 109 // worker. Unlike the other functions in this interface, Ping() does not
92 // dispatch an event. 110 // dispatch an event.
93 Ping() => (); 111 Ping() => ();
94 }; 112 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698