OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 module content.mojom; | 5 module content.mojom; |
6 | 6 |
7 import "content/common/service_worker/service_worker_event_dispatcher.mojom"; | 7 import "content/common/service_worker/service_worker_event_dispatcher.mojom"; |
8 import "mojo/common/string16.mojom"; | |
8 import "services/service_manager/public/interfaces/interface_provider.mojom"; | 9 import "services/service_manager/public/interfaces/interface_provider.mojom"; |
9 import "third_party/WebKit/public/web/console_message.mojom"; | 10 import "third_party/WebKit/public/web/console_message.mojom"; |
10 import "url/mojo/url.mojom"; | 11 import "url/mojo/url.mojom"; |
11 | 12 |
12 [Native] | 13 [Native] |
13 struct EmbeddedWorkerStartParams; | 14 struct EmbeddedWorkerStartParams; |
14 | 15 |
15 // Interface to control a renderer-side worker's environment. | 16 // Interface to control a renderer-side embedded worker. The browser uses this |
17 // interface to start, stop, and issue commands to the worker. | |
16 interface EmbeddedWorkerInstanceClient { | 18 interface EmbeddedWorkerInstanceClient { |
17 StartWorker(EmbeddedWorkerStartParams params, | 19 StartWorker(EmbeddedWorkerStartParams params, |
18 ServiceWorkerEventDispatcher& dispatcher_request); | 20 ServiceWorkerEventDispatcher& dispatcher_request, |
19 StopWorker() => (); | 21 associated EmbeddedWorkerInstanceHost instance_host); |
22 // The response is sent back via EmbeddedWorkerInstanceHost.OnStopped(). | |
23 StopWorker(); | |
20 ResumeAfterDownload(); | 24 ResumeAfterDownload(); |
21 AddMessageToConsole(blink.mojom.ConsoleMessageLevel level, | 25 AddMessageToConsole(blink.mojom.ConsoleMessageLevel level, |
22 string message); | 26 string message); |
23 }; | 27 }; |
28 | |
29 // Interface to control a browser-side embedded worker instance. The renderer | |
30 // uses this interface to report embedded worker state back to the browser. | |
31 // This interface is associated with the EmbeddedWorkerInstanceClient interface. | |
32 interface EmbeddedWorkerInstanceHost { | |
33 // Sent on main thread. | |
falken
2017/04/11 14:27:36
I'm curious why it's important to document sent on
leonhsl(Using Gerrit)
2017/04/12 03:34:04
Acknowledged.
leonhsl(Using Gerrit)
2017/04/12 12:32:12
Yes 'sent on xxx thread' is just describing the cu
| |
34 // Indicates that the worker is ready for inspection. | |
35 OnReadyForInspection(); | |
36 // Indicates that the worker has loaded the script. | |
37 OnScriptLoaded(); | |
38 // Indicates that the worker has failed to load the script. | |
39 OnScriptLoadFailed(); | |
40 // Indicates that the worker is stopped. | |
falken
2017/04/11 14:27:36
nit: just "that the worker stopped"
leonhsl(Using Gerrit)
2017/04/12 03:34:04
Acknowledged.
leonhsl(Using Gerrit)
2017/04/12 12:32:12
Done.
| |
41 OnStopped(); | |
42 | |
43 // Sent on worker thread. | |
44 // Indicates that the worker thread is started. |thread_id| is the actual | |
45 // platform thread id on which the worker runs, while |provider_id| is the id | |
46 // of each ServiceWorkerNetworkProvider instance, which is unique in one | |
47 // renderer process, and the browser process uses this id to maintain a | |
48 // counterpart ServiceWorkerProviderHost instance. | |
49 OnThreadStarted(int32 thread_id, int32 provider_id); | |
50 // Indicates that the worker has evaluated the script. |success| means | |
51 // evaluating the script completed and no uncaught exception occurred. | |
52 OnScriptEvaluated(bool success); | |
53 // Indicates that the worker is started. | |
falken
2017/04/11 14:27:36
nit: just "that the worker started"
leonhsl(Using Gerrit)
2017/04/12 03:34:04
Acknowledged.
leonhsl(Using Gerrit)
2017/04/12 12:32:12
Done.
| |
54 OnStarted(); | |
55 // Reports an exception. | |
56 OnReportException(mojo.common.mojom.String16 error_message, int32 line_number, | |
57 int32 column_number, url.mojom.Url source_url); | |
58 // Reports console message. | |
59 OnReportConsoleMessage(int32 source_identifier, int32 message_level, | |
60 mojo.common.mojom.String16 message, int32 line_number, | |
61 url.mojom.Url source_url); | |
62 }; | |
OLD | NEW |