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

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

Issue 2748213003: Service Worker event dispatcher for Background Fetch (Closed)
Patch Set: uma fix 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 ExtendableMessageEventSource; 25 struct ExtendableMessageEventSource;
26 26
27 enum BackgroundFetchState {
28 PENDING,
29 SUCCEEDED,
30 FAILED
31 };
32
27 struct FetchEventPreloadHandle { 33 struct FetchEventPreloadHandle {
28 URLLoader url_loader; 34 URLLoader url_loader;
29 URLLoaderClient& url_loader_client_request; 35 URLLoaderClient& url_loader_client_request;
30 }; 36 };
31 37
32 struct ExtendableMessageEvent { 38 struct ExtendableMessageEvent {
33 mojo.common.mojom.String16 message; 39 mojo.common.mojom.String16 message;
34 url.mojom.Origin source_origin; 40 url.mojom.Origin source_origin;
35 array<handle<message_pipe>> message_ports; 41 array<handle<message_pipe>> message_ports;
36 ExtendableMessageEventSource source; 42 ExtendableMessageEventSource source;
37 }; 43 };
38 44
39 // Renderer-side interface bound to ServiceWorkerContextClient for dispatching 45 // Renderer-side interface bound to ServiceWorkerContextClient for dispatching
40 // events. 46 // events.
41 interface ServiceWorkerEventDispatcher { 47 interface ServiceWorkerEventDispatcher {
42 DispatchActivateEvent() 48 DispatchActivateEvent()
43 => (blink.mojom.ServiceWorkerEventStatus status, 49 => (blink.mojom.ServiceWorkerEventStatus status,
44 mojo.common.mojom.Time dispatch_event_time); 50 mojo.common.mojom.Time dispatch_event_time);
51 DispatchBackgroundFetchAbortEvent(string tag)
52 => (blink.mojom.ServiceWorkerEventStatus status,
53 mojo.common.mojom.Time dispatch_event_time);
54 DispatchBackgroundFetchClickEvent(string tag, BackgroundFetchState state)
55 => (blink.mojom.ServiceWorkerEventStatus status,
56 mojo.common.mojom.Time dispatch_event_time);
45 // |fetch_event_id| is used internally when sending the response back to the 57 // |fetch_event_id| is used internally when sending the response back to the
46 // browser process. 58 // browser process.
47 DispatchFetchEvent(int32 fetch_event_id, ServiceWorkerFetchRequest request, 59 DispatchFetchEvent(int32 fetch_event_id, ServiceWorkerFetchRequest request,
48 FetchEventPreloadHandle? preload_handle) 60 FetchEventPreloadHandle? preload_handle)
49 => (blink.mojom.ServiceWorkerEventStatus status, 61 => (blink.mojom.ServiceWorkerEventStatus status,
50 mojo.common.mojom.Time dispatch_event_time); 62 mojo.common.mojom.Time dispatch_event_time);
51 DispatchNotificationClickEvent(string notification_id, 63 DispatchNotificationClickEvent(string notification_id,
52 PlatformNotificationData notification_data, 64 PlatformNotificationData notification_data,
53 int32 action_index, 65 int32 action_index,
54 mojo.common.mojom.String16? reply) 66 mojo.common.mojom.String16? reply)
(...skipping 12 matching lines...) Expand all
67 blink.mojom.BackgroundSyncEventLastChance last_chance) 79 blink.mojom.BackgroundSyncEventLastChance last_chance)
68 => (blink.mojom.ServiceWorkerEventStatus status, 80 => (blink.mojom.ServiceWorkerEventStatus status,
69 mojo.common.mojom.Time dispatch_event_time); 81 mojo.common.mojom.Time dispatch_event_time);
70 DispatchPaymentRequestEvent(payments.mojom.PaymentAppRequest app_request) 82 DispatchPaymentRequestEvent(payments.mojom.PaymentAppRequest app_request)
71 => (blink.mojom.ServiceWorkerEventStatus status, 83 => (blink.mojom.ServiceWorkerEventStatus status,
72 mojo.common.mojom.Time dispatch_event_time); 84 mojo.common.mojom.Time dispatch_event_time);
73 DispatchExtendableMessageEvent(ExtendableMessageEvent event) 85 DispatchExtendableMessageEvent(ExtendableMessageEvent event)
74 => (blink.mojom.ServiceWorkerEventStatus status, 86 => (blink.mojom.ServiceWorkerEventStatus status,
75 mojo.common.mojom.Time dispatch_event_time); 87 mojo.common.mojom.Time dispatch_event_time);
76 }; 88 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698