Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 module content.mojom; | |
| 6 | |
| 7 import "mojo/common/string16.mojom"; | |
| 8 import "url/mojo/url.mojom"; | |
| 9 | |
| 10 [Native] | |
| 11 enum WebContentSecurityPolicyType; | |
| 12 | |
| 13 [Native] | |
| 14 enum WebSharedWorkerCreationContextType; | |
| 15 | |
| 16 [Native] | |
| 17 enum WebAddressSpace; | |
| 18 | |
| 19 [Native] | |
| 20 enum WebWorkerCreationError; | |
| 21 | |
| 22 struct SharedWorker_CreateWorker_Params { | |
|
shimazu
2017/01/11 03:40:17
I think it's okay to obey the usual naming convent
nhiroki
2017/01/11 05:16:58
Done.
| |
| 23 // URL for the worker script. | |
| 24 url.mojom.Url url; | |
| 25 | |
| 26 // Name for a SharedWorker, otherwise empty string. | |
| 27 mojo.common.mojom.String16 name; | |
| 28 | |
| 29 // Security policy used in the worker. | |
| 30 mojo.common.mojom.String16 content_security_policy; | |
| 31 | |
| 32 // Security policy type used in the worker. | |
| 33 WebContentSecurityPolicyType security_policy_type; | |
| 34 | |
| 35 // The ID of the parent document (unique within parent renderer). | |
| 36 uint64 document_id; | |
| 37 | |
| 38 // RenderFrame routing id used to send messages back to the parent. | |
| 39 int32 render_frame_route_id; | |
| 40 | |
| 41 // Address space of the context that created the worker. | |
| 42 WebAddressSpace creation_address_space; | |
| 43 | |
| 44 // The type (secure or nonsecure) of the context that created the worker. | |
| 45 WebSharedWorkerCreationContextType creation_context_type; | |
| 46 }; | |
| 47 | |
| 48 // Per-process browser-side interface bound to SharedWorkerMessageFilter. | |
| 49 // Each InterfacePtrs on the same render process will be bound to the same | |
| 50 // SharedWorkerMessageFilter. | |
| 51 interface SharedWorkerMessageFilter { | |
|
shimazu
2017/01/11 03:40:17
How about mojofying SharedWorkerService instead of
nhiroki
2017/01/11 05:16:58
SharedWorkerServiceImpl is a singleton object and
shimazu
2017/01/11 06:10:45
Oops, sorry, I got it.
I missed that currently rou
| |
| 52 // A renderer calls this to the browser process when it wants to create a | |
| 53 // worker. The browser will create the worker process if necessary, and | |
| 54 // will return the route id. | |
| 55 // TODO(nhiroki): This route id will be removed when browser->renderer(worker) | |
|
shimazu
2017/01/11 03:40:17
The route_id can be removed after mojofying WebSha
nhiroki
2017/01/11 05:16:58
I see. I wrongly assumed this |route_id| represent
| |
| 56 // communication is mojofied (https://crbug.com/612308). | |
| 57 // TODO(nhiroki): Make this asynchronous (https://crbug.com/679654). | |
| 58 [Sync] | |
| 59 OnCreateWorker(SharedWorker_CreateWorker_Params params) | |
| 60 => (int32 route_id, WebWorkerCreationError error); | |
| 61 | |
| 62 // A renderer calls this to the browser process when a document has been | |
| 63 // detached. The browser will use this to constrain the lifecycle of the | |
| 64 // renderer process where the associated worker runs (SharedWorkers are shut | |
| 65 // down when their last associated document is detached). | |
| 66 OnDocumentDetached(uint64 document_id); | |
| 67 | |
| 68 // A renderer sends this to the browser process when it wants to connect to | |
| 69 // the worker that is specified by the route id. | |
| 70 OnConnectToWorker(int32 route_id, int32 sent_message_port_id); | |
| 71 }; | |
| OLD | NEW |