| // Copyright 2017 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| module blink.mojom; |
| |
| import "url/mojom/url.mojom"; |
| |
| // This is sent from the browser to the renderer on starting worker. |
| // Contains information about the scripts of an installed service worker. |
| struct ServiceWorkerInstalledScriptsInfo { |
| ServiceWorkerInstalledScriptsManager& manager_request; |
| ServiceWorkerInstalledScriptsManagerHost manager_host_ptr; |
| array<url.mojom.Url> installed_urls; |
| }; |
| |
| // This is sent from the browser to the renderer. |
| // Contains information about a service worker script. |
| struct ServiceWorkerScriptInfo { |
| url.mojom.Url script_url; |
| string encoding; |
| // HTTP headers of the script. |
| map<string, string> headers; |
| // A handle for receiving the script body. |
| handle<data_pipe_consumer> body; |
| uint64 body_size; |
| // A handle for receiving the V8 code cached metadata. This is null when no |
| // meta data is available. |
| handle<data_pipe_consumer>? meta_data; |
| uint64 meta_data_size; |
| }; |
| |
| // Browser-side interface. The renderer uses this interface to request installed |
| // scripts from the browser process. |
| interface ServiceWorkerInstalledScriptsManagerHost { |
| // Requests to send the installed scripts over |
| // ServiceWorkerInstalledScriptsManager::TransferInstalledScript. |
| RequestInstalledScript(url.mojom.Url script_url); |
| }; |
| |
| // Renderer-side interface. The browser uses this interface to send |
| // information about installed scripts to the renderer. |
| interface ServiceWorkerInstalledScriptsManager { |
| // Starts streaming the script to the renderer. |
| TransferInstalledScript(ServiceWorkerScriptInfo script_info); |
| }; |