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; | |
shimazu
2017/01/05 02:24:03
You should also create a typemap file to use [Nati
nhiroki
2017/01/10 08:44:06
Thank you for the pointer. Done.
| |
12 | |
13 [Native] | |
14 enum WebSharedWorkerCreationContextType; | |
15 | |
16 [Native] | |
17 enum WebAddressSpace; | |
18 | |
19 [Native] | |
20 enum WebWorkerCreationError; | |
21 | |
22 struct SharedWorker_CreateWorker_Params { | |
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 struct SharedWorker_CreateWorker_Reply { | |
49 // The route id for the created worker. | |
50 int32 route_id; | |
51 | |
52 // The error that occurred, if the browser failed to create the worker. | |
53 WebWorkerCreationError error; | |
54 }; | |
55 | |
56 // Per-process browser-side interface bound to SharedWorkerMessageFilter. | |
57 // Each InterfacePtrs on the same render process will be bound to the same | |
58 // SharedWorkerMessageFilter. | |
59 interface SharedWorkerMessageFilter { | |
60 // A renderer calls this to the browser process when it wants to create a | |
61 // worker. The browser will create the worker process if necessary, and | |
62 // will return the route id on in the reply on success. On error returns | |
63 // MSG_ROUTING_NONE and an error type. | |
kinuko
2017/01/05 08:13:13
Are we eventually deprecating route_id from the wo
kinuko
2017/01/05 08:13:13
This comment looks stale
nhiroki
2017/01/10 08:44:05
You're right. Added comments.
nhiroki
2017/01/10 08:44:06
Done.
| |
64 [Sync] | |
horo
2017/01/06 04:18:13
We don't need to throw a DOM exception for URLMism
nhiroki
2017/01/10 08:44:05
Good point. I'd like to work on it in a separate C
| |
65 OnCreateWorker(SharedWorker_CreateWorker_Params params) | |
66 => (SharedWorker_CreateWorker_Reply reply); | |
kinuko
2017/01/05 08:13:14
We could probably just return route_id and error w
nhiroki
2017/01/10 08:44:06
Done.
| |
67 | |
68 // A renderer calls this to the browser process when a document has been | |
69 // detached. The browser will use this to constrain the lifecycle of worker | |
70 // processes (SharedWorkers are shut down when their last associated document | |
kinuko
2017/01/05 08:13:14
'worker processes' -> 'the renderer process where
nhiroki
2017/01/10 08:44:05
Done.
| |
71 // is detached). | |
72 OnDocumentDetached(uint64 document_id); | |
73 | |
74 // A renderer sends this to the browser process when it wants to connect to a | |
75 // worker. | |
kinuko
2017/01/05 08:13:13
a worker -> the worker that is specified by route_
nhiroki
2017/01/10 08:44:06
Done.
| |
76 OnConnectToWorker(int32 route_id, int32 sent_message_port_id); | |
77 }; | |
OLD | NEW |