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..52fb06647e776410268e0ad09f313aa335c79b10 |
--- /dev/null |
+++ b/content/common/shared_worker.mojom |
@@ -0,0 +1,72 @@ |
+// 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 SharedWorkerCreateParams { |
+ // 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 |
kinuko
2017/01/11 06:06:43
nit: Each InterfacePtrs -> Each InterfacePtr or Al
|
+// SharedWorkerMessageFilter. |
+interface SharedWorkerMessageFilter { |
+ // 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(document) communication is mojofied. |
+ // (https://crbug.com/612308) |
+ // TODO(nhiroki): Make this asynchronous (https://crbug.com/679654). |
kinuko
2017/01/11 06:06:43
I feel we could do the necessary refactoring to ma
nhiroki
2017/01/11 07:48:56
Hmmm... I tried this and was stuck. How do we noti
kinuko
2017/01/11 11:51:46
I have imagined that we do necessary refactoring f
nhiroki
2017/01/12 04:05:27
Ah, I understand what you mean. You mean the follo
|
+ [Sync] |
+ OnCreateWorker(SharedWorkerCreateParams 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); |
+}; |