OLD | NEW |
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"; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 URLLoaderClient& url_loader_client_request; | 43 URLLoaderClient& url_loader_client_request; |
44 }; | 44 }; |
45 | 45 |
46 struct ExtendableMessageEvent { | 46 struct ExtendableMessageEvent { |
47 mojo.common.mojom.String16 message; | 47 mojo.common.mojom.String16 message; |
48 url.mojom.Origin source_origin; | 48 url.mojom.Origin source_origin; |
49 array<handle<message_pipe>> message_ports; | 49 array<handle<message_pipe>> message_ports; |
50 ExtendableMessageEventSource source; | 50 ExtendableMessageEventSource source; |
51 }; | 51 }; |
52 | 52 |
| 53 interface ServiceWorkerFetchResponseReceiver { |
| 54 OnResponse(ServiceWorkerResponse response, mojo.common.mojom.Time dispatch_eve
nt_time); |
| 55 OnResponseStream(ServiceWorkerResponse response, handle<data_pipe_consumer> st
ream, mojo.common.mojom.Time dispatch_event_time); |
| 56 OnFallback(mojo.common.mojom.Time dispatch_event_time); |
| 57 }; |
| 58 |
53 // Renderer-side interface bound to ServiceWorkerContextClient for dispatching | 59 // Renderer-side interface bound to ServiceWorkerContextClient for dispatching |
54 // events. | 60 // events. |
55 // Those events expecting such response | 61 // Those events expecting such response |
56 // (blink.mojom.ServiceWorkerEventStatus, mojo.common.mojom.Time) are considered | 62 // (blink.mojom.ServiceWorkerEventStatus, mojo.common.mojom.Time) are considered |
57 // 'simple events'. ServiceWorkerVersion::CreateSimpleEventCallback can be used | 63 // 'simple events'. ServiceWorkerVersion::CreateSimpleEventCallback can be used |
58 // to create the callback for these. | 64 // to create the callback for these. |
59 interface ServiceWorkerEventDispatcher { | 65 interface ServiceWorkerEventDispatcher { |
60 DispatchActivateEvent() | 66 DispatchActivateEvent() |
61 => (blink.mojom.ServiceWorkerEventStatus status, | 67 => (blink.mojom.ServiceWorkerEventStatus status, |
62 mojo.common.mojom.Time dispatch_event_time); | 68 mojo.common.mojom.Time dispatch_event_time); |
63 DispatchBackgroundFetchAbortEvent(string tag) | 69 DispatchBackgroundFetchAbortEvent(string tag) |
64 => (blink.mojom.ServiceWorkerEventStatus status, | 70 => (blink.mojom.ServiceWorkerEventStatus status, |
65 mojo.common.mojom.Time dispatch_event_time); | 71 mojo.common.mojom.Time dispatch_event_time); |
66 DispatchBackgroundFetchClickEvent(string tag, BackgroundFetchState state) | 72 DispatchBackgroundFetchClickEvent(string tag, BackgroundFetchState state) |
67 => (blink.mojom.ServiceWorkerEventStatus status, | 73 => (blink.mojom.ServiceWorkerEventStatus status, |
68 mojo.common.mojom.Time dispatch_event_time); | 74 mojo.common.mojom.Time dispatch_event_time); |
69 DispatchBackgroundFetchFailEvent(string tag, | 75 DispatchBackgroundFetchFailEvent(string tag, |
70 array<BackgroundFetchSettledFetch> fetches) | 76 array<BackgroundFetchSettledFetch> fetches) |
71 => (blink.mojom.ServiceWorkerEventStatus status, | 77 => (blink.mojom.ServiceWorkerEventStatus status, |
72 mojo.common.mojom.Time dispatch_event_time); | 78 mojo.common.mojom.Time dispatch_event_time); |
73 DispatchBackgroundFetchedEvent(string tag, | 79 DispatchBackgroundFetchedEvent(string tag, |
74 array<BackgroundFetchSettledFetch> fetches) | 80 array<BackgroundFetchSettledFetch> fetches) |
75 => (blink.mojom.ServiceWorkerEventStatus status, | 81 => (blink.mojom.ServiceWorkerEventStatus status, |
76 mojo.common.mojom.Time dispatch_event_time); | 82 mojo.common.mojom.Time dispatch_event_time); |
77 // |fetch_event_id| is used internally when sending the response back to the | 83 // |fetch_event_id| is used internally when sending the response back to the |
78 // browser process. | 84 // browser process. |
79 DispatchFetchEvent(int32 fetch_event_id, blink.mojom.FetchAPIRequest request, | 85 DispatchFetchEvent(int32 fetch_event_id, blink.mojom.FetchAPIRequest request, |
80 FetchEventPreloadHandle? preload_handle) | 86 FetchEventPreloadHandle? preload_handle, |
| 87 ServiceWorkerFetchResponseReceiver receiver) |
81 => (blink.mojom.ServiceWorkerEventStatus status, | 88 => (blink.mojom.ServiceWorkerEventStatus status, |
82 mojo.common.mojom.Time dispatch_event_time); | 89 mojo.common.mojom.Time dispatch_event_time); |
83 DispatchNotificationClickEvent(string notification_id, | 90 DispatchNotificationClickEvent(string notification_id, |
84 PlatformNotificationData notification_data, | 91 PlatformNotificationData notification_data, |
85 int32 action_index, | 92 int32 action_index, |
86 mojo.common.mojom.String16? reply) | 93 mojo.common.mojom.String16? reply) |
87 => (blink.mojom.ServiceWorkerEventStatus status, | 94 => (blink.mojom.ServiceWorkerEventStatus status, |
88 mojo.common.mojom.Time dispatch_event_time); | 95 mojo.common.mojom.Time dispatch_event_time); |
89 DispatchNotificationCloseEvent(string notification_id, | 96 DispatchNotificationCloseEvent(string notification_id, |
90 PlatformNotificationData notification_data) | 97 PlatformNotificationData notification_data) |
(...skipping 16 matching lines...) Expand all Loading... |
107 DispatchExtendableMessageEvent(ExtendableMessageEvent event) | 114 DispatchExtendableMessageEvent(ExtendableMessageEvent event) |
108 => (blink.mojom.ServiceWorkerEventStatus status, | 115 => (blink.mojom.ServiceWorkerEventStatus status, |
109 mojo.common.mojom.Time dispatch_event_time); | 116 mojo.common.mojom.Time dispatch_event_time); |
110 | 117 |
111 // Pings the service worker to check if it is responsive. If the callback is | 118 // Pings the service worker to check if it is responsive. If the callback is |
112 // not called within a certain period of time, the browser will terminate the | 119 // not called within a certain period of time, the browser will terminate the |
113 // worker. Unlike the other functions in this interface, Ping() does not | 120 // worker. Unlike the other functions in this interface, Ping() does not |
114 // dispatch an event. | 121 // dispatch an event. |
115 Ping() => (); | 122 Ping() => (); |
116 }; | 123 }; |
OLD | NEW |