Chromium Code Reviews| Index: content/common/service_worker/service_worker_event_dispatcher.mojom | 
| diff --git a/content/common/service_worker/service_worker_event_dispatcher.mojom b/content/common/service_worker/service_worker_event_dispatcher.mojom | 
| index 2f309bb3bd2729fcd745f61b71b0c43a55cd34f3..c865fd57f465e6efc1764d8b8997363557950270 100644 | 
| --- a/content/common/service_worker/service_worker_event_dispatcher.mojom | 
| +++ b/content/common/service_worker/service_worker_event_dispatcher.mojom | 
| @@ -11,6 +11,7 @@ import "mojo/common/time.mojom"; | 
| import "third_party/WebKit/public/platform/modules/background_sync/background_sync.mojom"; | 
| import "third_party/WebKit/public/platform/modules/fetch/fetch_api_request.mojom"; | 
| import "third_party/WebKit/public/platform/modules/serviceworker/service_worker_event_status.mojom"; | 
| +import "third_party/WebKit/public/platform/modules/serviceworker/service_worker_stream_handle.mojom"; | 
| import "url/mojo/origin.mojom"; | 
| [Native] | 
| @@ -50,6 +51,20 @@ struct ExtendableMessageEvent { | 
| ExtendableMessageEventSource source; | 
| }; | 
| +// Browser-side interface which is passed through DispatchFetchEvent. The | 
| +// renderer uses this interface to respond to a fetch event. This interface is | 
| +// 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.
 
 | 
| +// TODO(shimazu): Use this interface for all responses after the blob system is | 
| +// mojoified: https://crbug.com/611935. | 
| +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.
 
 | 
| + OnResponse(ServiceWorkerResponse response, | 
| + 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.
 
 | 
| + OnResponseStream(ServiceWorkerResponse response, | 
| + 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.
 
 | 
| + 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.
 
 | 
| + OnFallback(mojo.common.mojom.Time dispatch_event_time); | 
| +}; | 
| + | 
| // Renderer-side interface bound to ServiceWorkerContextClient for dispatching | 
| // events. | 
| // Those events expecting such response | 
| @@ -77,7 +92,8 @@ interface ServiceWorkerEventDispatcher { | 
| // |fetch_event_id| is used internally when sending the response back to the | 
| // 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.
 
 | 
| DispatchFetchEvent(int32 fetch_event_id, blink.mojom.FetchAPIRequest request, | 
| - FetchEventPreloadHandle? preload_handle) | 
| + FetchEventPreloadHandle? preload_handle, | 
| + ServiceWorkerFetchResponseCallback response_callback) | 
| => (blink.mojom.ServiceWorkerEventStatus status, | 
| mojo.common.mojom.Time dispatch_event_time); | 
| DispatchNotificationClickEvent(string notification_id, |