Chromium Code Reviews| Index: content/common/shared_worker.mojom |
| diff --git a/content/common/shared_worker.mojom b/content/common/shared_worker.mojom |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..948c73b5629fb5afba33baccb90b04c4829bf7cb |
| --- /dev/null |
| +++ b/content/common/shared_worker.mojom |
| @@ -0,0 +1,71 @@ |
| +// 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 content.mojom; |
| + |
| +import "mojo/common/string16.mojom"; |
| +import "url/mojo/url.mojom"; |
| + |
| +[Native] |
| +enum WebContentSecurityPolicyType; |
| + |
| +[Native] |
| +enum WebSharedWorkerCreationContextType; |
| + |
| +[Native] |
| +enum WebAddressSpace; |
| + |
| +[Native] |
| +enum WebWorkerCreationError; |
| + |
| +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.
|
| + // URL for the worker script. |
| + url.mojom.Url url; |
| + |
| + // Name for a SharedWorker, otherwise empty string. |
| + mojo.common.mojom.String16 name; |
| + |
| + // Security policy used in the worker. |
| + mojo.common.mojom.String16 content_security_policy; |
| + |
| + // Security policy type used in the worker. |
| + WebContentSecurityPolicyType security_policy_type; |
| + |
| + // The ID of the parent document (unique within parent renderer). |
| + uint64 document_id; |
| + |
| + // RenderFrame routing id used to send messages back to the parent. |
| + int32 render_frame_route_id; |
| + |
| + // Address space of the context that created the worker. |
| + WebAddressSpace creation_address_space; |
| + |
| + // The type (secure or nonsecure) of the context that created the worker. |
| + WebSharedWorkerCreationContextType creation_context_type; |
| +}; |
| + |
| +// Per-process browser-side interface bound to SharedWorkerMessageFilter. |
| +// Each InterfacePtrs on the same render process will be bound to the same |
| +// SharedWorkerMessageFilter. |
| +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
|
| + // A renderer calls this to the browser process when it wants to create a |
| + // worker. The browser will create the worker process if necessary, and |
| + // will return the route id. |
| + // 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
|
| + // communication is mojofied (https://crbug.com/612308). |
| + // TODO(nhiroki): Make this asynchronous (https://crbug.com/679654). |
| + [Sync] |
| + OnCreateWorker(SharedWorker_CreateWorker_Params params) |
| + => (int32 route_id, WebWorkerCreationError error); |
| + |
| + // A renderer calls this to the browser process when a document has been |
| + // detached. The browser will use this to constrain the lifecycle of the |
| + // renderer process where the associated worker runs (SharedWorkers are shut |
| + // down when their last associated document is detached). |
| + OnDocumentDetached(uint64 document_id); |
| + |
| + // A renderer sends this to the browser process when it wants to connect to |
| + // the worker that is specified by the route id. |
| + OnConnectToWorker(int32 route_id, int32 sent_message_port_id); |
| +}; |