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. The | |
| 55 // renderer uses this interface to respond to a fetch event. This interface is | |
| 56 // only used for responses where the body is a stream or doesn't exist. | |
|
falken
2017/04/12 08:00:16
nit: Add "when the body is a blob, the legacy IPC
shimazu
2017/04/18 01:50:04
Done.
| |
| 57 // TODO(shimazu): Use this interface for all responses after the blob system is | |
| 58 // mojoified: https://crbug.com/611935. | |
| 59 interface ServiceWorkerFetchResponseCallback { | |
|
falken
2017/04/12 08:00:16
// Responds to the request with |response|. The bo
shimazu
2017/04/18 01:50:04
Done.
| |
| 60 OnResponse(ServiceWorkerResponse response, | |
| 61 mojo.common.mojom.Time dispatch_event_time); | |
|
falken
2017/04/12 08:00:16
// Responds to the request with |response|. The bo
shimazu
2017/04/18 01:50:04
Done.
| |
| 62 OnResponseStream(ServiceWorkerResponse response, | |
| 63 blink.mojom.ServiceWorkerStreamHandle stream_handle, | |
|
falken
2017/04/12 08:00:16
Is it easier to understand if "stream_handle" is r
shimazu
2017/04/18 01:50:04
Done.
| |
| 64 mojo.common.mojom.Time dispatch_event_time); | |
|
falken
2017/04/12 08:00:16
// Provides no response to the request. The browse
shimazu
2017/04/18 01:50:04
Done.
| |
| 65 OnFallback(mojo.common.mojom.Time dispatch_event_time); | |
| 66 }; | |
| 67 | |
| 53 // Renderer-side interface bound to ServiceWorkerContextClient for dispatching | 68 // Renderer-side interface bound to ServiceWorkerContextClient for dispatching |
| 54 // events. | 69 // events. |
| 55 // Those events expecting such response | 70 // Those events expecting such response |
| 56 // (blink.mojom.ServiceWorkerEventStatus, mojo.common.mojom.Time) are considered | 71 // (blink.mojom.ServiceWorkerEventStatus, mojo.common.mojom.Time) are considered |
| 57 // 'simple events'. ServiceWorkerVersion::CreateSimpleEventCallback can be used | 72 // 'simple events'. ServiceWorkerVersion::CreateSimpleEventCallback can be used |
| 58 // to create the callback for these. | 73 // to create the callback for these. |
| 59 interface ServiceWorkerEventDispatcher { | 74 interface ServiceWorkerEventDispatcher { |
| 60 DispatchActivateEvent() | 75 DispatchActivateEvent() |
| 61 => (blink.mojom.ServiceWorkerEventStatus status, | 76 => (blink.mojom.ServiceWorkerEventStatus status, |
| 62 mojo.common.mojom.Time dispatch_event_time); | 77 mojo.common.mojom.Time dispatch_event_time); |
| 63 DispatchBackgroundFetchAbortEvent(string tag) | 78 DispatchBackgroundFetchAbortEvent(string tag) |
| 64 => (blink.mojom.ServiceWorkerEventStatus status, | 79 => (blink.mojom.ServiceWorkerEventStatus status, |
| 65 mojo.common.mojom.Time dispatch_event_time); | 80 mojo.common.mojom.Time dispatch_event_time); |
| 66 DispatchBackgroundFetchClickEvent(string tag, BackgroundFetchState state) | 81 DispatchBackgroundFetchClickEvent(string tag, BackgroundFetchState state) |
| 67 => (blink.mojom.ServiceWorkerEventStatus status, | 82 => (blink.mojom.ServiceWorkerEventStatus status, |
| 68 mojo.common.mojom.Time dispatch_event_time); | 83 mojo.common.mojom.Time dispatch_event_time); |
| 69 DispatchBackgroundFetchFailEvent(string tag, | 84 DispatchBackgroundFetchFailEvent(string tag, |
| 70 array<BackgroundFetchSettledFetch> fetches) | 85 array<BackgroundFetchSettledFetch> fetches) |
| 71 => (blink.mojom.ServiceWorkerEventStatus status, | 86 => (blink.mojom.ServiceWorkerEventStatus status, |
| 72 mojo.common.mojom.Time dispatch_event_time); | 87 mojo.common.mojom.Time dispatch_event_time); |
| 73 DispatchBackgroundFetchedEvent(string tag, | 88 DispatchBackgroundFetchedEvent(string tag, |
| 74 array<BackgroundFetchSettledFetch> fetches) | 89 array<BackgroundFetchSettledFetch> fetches) |
| 75 => (blink.mojom.ServiceWorkerEventStatus status, | 90 => (blink.mojom.ServiceWorkerEventStatus status, |
| 76 mojo.common.mojom.Time dispatch_event_time); | 91 mojo.common.mojom.Time dispatch_event_time); |
| 77 // |fetch_event_id| is used internally when sending the response back to the | 92 // |fetch_event_id| is used internally when sending the response back to the |
| 78 // browser process. | 93 // browser process. |
|
falken
2017/04/12 08:00:16
Can you add a comment explaining why this takes bo
shimazu
2017/04/18 01:50:04
Done.
| |
| 79 DispatchFetchEvent(int32 fetch_event_id, blink.mojom.FetchAPIRequest request, | 94 DispatchFetchEvent(int32 fetch_event_id, blink.mojom.FetchAPIRequest request, |
| 80 FetchEventPreloadHandle? preload_handle) | 95 FetchEventPreloadHandle? preload_handle, |
| 96 ServiceWorkerFetchResponseCallback response_callback) | |
| 81 => (blink.mojom.ServiceWorkerEventStatus status, | 97 => (blink.mojom.ServiceWorkerEventStatus status, |
| 82 mojo.common.mojom.Time dispatch_event_time); | 98 mojo.common.mojom.Time dispatch_event_time); |
| 83 DispatchNotificationClickEvent(string notification_id, | 99 DispatchNotificationClickEvent(string notification_id, |
| 84 PlatformNotificationData notification_data, | 100 PlatformNotificationData notification_data, |
| 85 int32 action_index, | 101 int32 action_index, |
| 86 mojo.common.mojom.String16? reply) | 102 mojo.common.mojom.String16? reply) |
| 87 => (blink.mojom.ServiceWorkerEventStatus status, | 103 => (blink.mojom.ServiceWorkerEventStatus status, |
| 88 mojo.common.mojom.Time dispatch_event_time); | 104 mojo.common.mojom.Time dispatch_event_time); |
| 89 DispatchNotificationCloseEvent(string notification_id, | 105 DispatchNotificationCloseEvent(string notification_id, |
| 90 PlatformNotificationData notification_data) | 106 PlatformNotificationData notification_data) |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 107 DispatchExtendableMessageEvent(ExtendableMessageEvent event) | 123 DispatchExtendableMessageEvent(ExtendableMessageEvent event) |
| 108 => (blink.mojom.ServiceWorkerEventStatus status, | 124 => (blink.mojom.ServiceWorkerEventStatus status, |
| 109 mojo.common.mojom.Time dispatch_event_time); | 125 mojo.common.mojom.Time dispatch_event_time); |
| 110 | 126 |
| 111 // Pings the service worker to check if it is responsive. If the callback is | 127 // 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 | 128 // 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 | 129 // worker. Unlike the other functions in this interface, Ping() does not |
| 114 // dispatch an event. | 130 // dispatch an event. |
| 115 Ping() => (); | 131 Ping() => (); |
| 116 }; | 132 }; |
| OLD | NEW |