Chromium Code Reviews| 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"; | 
| 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/fetch/fetch_api_request.mojom "; | 12 import "third_party/WebKit/public/platform/modules/fetch/fetch_api_request.mojom "; | 
| 13 import "third_party/WebKit/public/platform/modules/serviceworker/service_worker_ event_status.mojom"; | 13 import "third_party/WebKit/public/platform/modules/serviceworker/service_worker_ event_status.mojom"; | 
| 14 import "third_party/WebKit/public/platform/modules/serviceworker/service_worker_ stream_handle.mojom"; | |
| 14 import "url/mojo/origin.mojom"; | 15 import "url/mojo/origin.mojom"; | 
| 15 | 16 | 
| 16 [Native] | 17 [Native] | 
| 17 struct PlatformNotificationData; | 18 struct PlatformNotificationData; | 
| 18 | 19 | 
| 19 [Native] | 20 [Native] | 
| 20 struct PushEventPayload; | 21 struct PushEventPayload; | 
| 21 | 22 | 
| 22 [Native] | 23 [Native] | 
| 23 struct ServiceWorkerResponse; | 24 struct ServiceWorkerResponse; | 
| (...skipping 19 matching lines...) Expand all Loading... | |
| 43 URLLoaderClient& url_loader_client_request; | 44 URLLoaderClient& url_loader_client_request; | 
| 44 }; | 45 }; | 
| 45 | 46 | 
| 46 struct ExtendableMessageEvent { | 47 struct ExtendableMessageEvent { | 
| 47 mojo.common.mojom.String16 message; | 48 mojo.common.mojom.String16 message; | 
| 48 url.mojom.Origin source_origin; | 49 url.mojom.Origin source_origin; | 
| 49 array<handle<message_pipe>> message_ports; | 50 array<handle<message_pipe>> message_ports; | 
| 50 ExtendableMessageEventSource source; | 51 ExtendableMessageEventSource source; | 
| 51 }; | 52 }; | 
| 52 | 53 | 
| 54 // Browser-side interface which is passed through DispatchFetchEvent. | |
| 55 // The legacy IPC is used when the response body is using blob storage due to | |
| 56 // the IPC's ordering issue. | |
| 
 
horo
2017/04/06 05:22:09
Could you please add TODO comment and a link to cr
 
shimazu
2017/04/07 08:52:29
Done.
 
 | |
| 57 interface ServiceWorkerFetchResponseCallback { | |
| 58 OnResponse(ServiceWorkerResponse response, | |
| 59 mojo.common.mojom.Time dispatch_event_time); | |
| 60 OnResponseStream(ServiceWorkerResponse response, | |
| 61 blink.mojom.ServiceWorkerStreamHandle stream_handle, | |
| 62 mojo.common.mojom.Time dispatch_event_time); | |
| 63 OnFallback(mojo.common.mojom.Time dispatch_event_time); | |
| 64 }; | |
| 65 | |
| 53 // Renderer-side interface bound to ServiceWorkerContextClient for dispatching | 66 // Renderer-side interface bound to ServiceWorkerContextClient for dispatching | 
| 54 // events. | 67 // events. | 
| 55 // Those events expecting such response | 68 // Those events expecting such response | 
| 56 // (blink.mojom.ServiceWorkerEventStatus, mojo.common.mojom.Time) are considered | 69 // (blink.mojom.ServiceWorkerEventStatus, mojo.common.mojom.Time) are considered | 
| 57 // 'simple events'. ServiceWorkerVersion::CreateSimpleEventCallback can be used | 70 // 'simple events'. ServiceWorkerVersion::CreateSimpleEventCallback can be used | 
| 58 // to create the callback for these. | 71 // to create the callback for these. | 
| 59 interface ServiceWorkerEventDispatcher { | 72 interface ServiceWorkerEventDispatcher { | 
| 60 DispatchActivateEvent() | 73 DispatchActivateEvent() | 
| 61 => (blink.mojom.ServiceWorkerEventStatus status, | 74 => (blink.mojom.ServiceWorkerEventStatus status, | 
| 62 mojo.common.mojom.Time dispatch_event_time); | 75 mojo.common.mojom.Time dispatch_event_time); | 
| 63 DispatchBackgroundFetchAbortEvent(string tag) | 76 DispatchBackgroundFetchAbortEvent(string tag) | 
| 64 => (blink.mojom.ServiceWorkerEventStatus status, | 77 => (blink.mojom.ServiceWorkerEventStatus status, | 
| 65 mojo.common.mojom.Time dispatch_event_time); | 78 mojo.common.mojom.Time dispatch_event_time); | 
| 66 DispatchBackgroundFetchClickEvent(string tag, BackgroundFetchState state) | 79 DispatchBackgroundFetchClickEvent(string tag, BackgroundFetchState state) | 
| 67 => (blink.mojom.ServiceWorkerEventStatus status, | 80 => (blink.mojom.ServiceWorkerEventStatus status, | 
| 68 mojo.common.mojom.Time dispatch_event_time); | 81 mojo.common.mojom.Time dispatch_event_time); | 
| 69 DispatchBackgroundFetchFailEvent(string tag, | 82 DispatchBackgroundFetchFailEvent(string tag, | 
| 70 array<BackgroundFetchSettledFetch> fetches) | 83 array<BackgroundFetchSettledFetch> fetches) | 
| 71 => (blink.mojom.ServiceWorkerEventStatus status, | 84 => (blink.mojom.ServiceWorkerEventStatus status, | 
| 72 mojo.common.mojom.Time dispatch_event_time); | 85 mojo.common.mojom.Time dispatch_event_time); | 
| 73 DispatchBackgroundFetchedEvent(string tag, | 86 DispatchBackgroundFetchedEvent(string tag, | 
| 74 array<BackgroundFetchSettledFetch> fetches) | 87 array<BackgroundFetchSettledFetch> fetches) | 
| 75 => (blink.mojom.ServiceWorkerEventStatus status, | 88 => (blink.mojom.ServiceWorkerEventStatus status, | 
| 76 mojo.common.mojom.Time dispatch_event_time); | 89 mojo.common.mojom.Time dispatch_event_time); | 
| 77 // |fetch_event_id| is used internally when sending the response back to the | 90 // |fetch_event_id| is used internally when sending the response back to the | 
| 78 // browser process. | 91 // browser process. | 
| 79 DispatchFetchEvent(int32 fetch_event_id, blink.mojom.FetchAPIRequest request, | 92 DispatchFetchEvent(int32 fetch_event_id, blink.mojom.FetchAPIRequest request, | 
| 80 FetchEventPreloadHandle? preload_handle) | 93 FetchEventPreloadHandle? preload_handle, | 
| 94 ServiceWorkerFetchResponseCallback response_callback) | |
| 81 => (blink.mojom.ServiceWorkerEventStatus status, | 95 => (blink.mojom.ServiceWorkerEventStatus status, | 
| 82 mojo.common.mojom.Time dispatch_event_time); | 96 mojo.common.mojom.Time dispatch_event_time); | 
| 83 DispatchNotificationClickEvent(string notification_id, | 97 DispatchNotificationClickEvent(string notification_id, | 
| 84 PlatformNotificationData notification_data, | 98 PlatformNotificationData notification_data, | 
| 85 int32 action_index, | 99 int32 action_index, | 
| 86 mojo.common.mojom.String16? reply) | 100 mojo.common.mojom.String16? reply) | 
| 87 => (blink.mojom.ServiceWorkerEventStatus status, | 101 => (blink.mojom.ServiceWorkerEventStatus status, | 
| 88 mojo.common.mojom.Time dispatch_event_time); | 102 mojo.common.mojom.Time dispatch_event_time); | 
| 89 DispatchNotificationCloseEvent(string notification_id, | 103 DispatchNotificationCloseEvent(string notification_id, | 
| 90 PlatformNotificationData notification_data) | 104 PlatformNotificationData notification_data) | 
| (...skipping 16 matching lines...) Expand all Loading... | |
| 107 DispatchExtendableMessageEvent(ExtendableMessageEvent event) | 121 DispatchExtendableMessageEvent(ExtendableMessageEvent event) | 
| 108 => (blink.mojom.ServiceWorkerEventStatus status, | 122 => (blink.mojom.ServiceWorkerEventStatus status, | 
| 109 mojo.common.mojom.Time dispatch_event_time); | 123 mojo.common.mojom.Time dispatch_event_time); | 
| 110 | 124 | 
| 111 // Pings the service worker to check if it is responsive. If the callback is | 125 // 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 | 126 // 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 | 127 // worker. Unlike the other functions in this interface, Ping() does not | 
| 114 // dispatch an event. | 128 // dispatch an event. | 
| 115 Ping() => (); | 129 Ping() => (); | 
| 116 }; | 130 }; | 
| OLD | NEW |