Chromium Code Reviews| Index: content/browser/service_worker/embedded_worker_instance.h |
| diff --git a/content/browser/service_worker/embedded_worker_instance.h b/content/browser/service_worker/embedded_worker_instance.h |
| index 737417c88ce30130b965a300a4ade9502c079d02..19228b3f7bdfe04e158397139abe2a8626a51caf 100644 |
| --- a/content/browser/service_worker/embedded_worker_instance.h |
| +++ b/content/browser/service_worker/embedded_worker_instance.h |
| @@ -43,6 +43,7 @@ namespace content { |
| class EmbeddedWorkerRegistry; |
| struct EmbeddedWorkerStartParams; |
| class ServiceWorkerContextCore; |
| +class ServiceWorkerProviderHost; |
| // This gives an interface to control one EmbeddedWorker instance, which |
| // may be 'in-waiting' or running in one of the child processes added by |
| @@ -110,6 +111,7 @@ class CONTENT_EXPORT EmbeddedWorkerInstance |
| // |params| should be populated with service worker version info needed |
| // to start the worker. |
|
kinuko
2017/06/14 08:37:40
Please document |provider_host|.
shimazu
2017/06/16 04:18:43
Done.
|
| void Start(std::unique_ptr<EmbeddedWorkerStartParams> params, |
| + base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
| mojom::ServiceWorkerEventDispatcherRequest dispatcher_request, |
| const StatusCallback& callback); |
| @@ -228,7 +230,7 @@ class CONTENT_EXPORT EmbeddedWorkerInstance |
| void OnScriptLoaded() override; |
| // Notifies the corresponding provider host that the thread has started and is |
| // ready to receive messages. |
| - void OnThreadStarted(int thread_id, int provider_id) override; |
| + void OnThreadStarted(int thread_id) override; |
| void OnScriptLoadFailed() override; |
| // Fires the callback passed to Start(). |
| void OnScriptEvaluated(bool success) override; |
| @@ -283,7 +285,10 @@ class CONTENT_EXPORT EmbeddedWorkerInstance |
| std::unique_ptr<EmbeddedWorkerInstance::WorkerProcessHandle> process_handle_; |
| int thread_id_; |
| - // |client_| is used to send messages to the renderer process. |
| + // |client_| is used to send messages to the renderer process. The browser |
| + // process should not disconnect the pipe because other associated interfaces |
| + // may be using it. The renderer process will disconnect the pipe when |
| + // appropriate. |
| mojom::EmbeddedWorkerInstanceClientPtr client_; |
| // Binding for EmbeddedWorkerInstanceHost, runs on IO thread. |
| @@ -293,6 +298,8 @@ class CONTENT_EXPORT EmbeddedWorkerInstance |
| // a mojo struct. |
| mojom::ServiceWorkerEventDispatcherRequest pending_dispatcher_request_; |
|
falken
2017/06/14 08:10:34
// The provider host that is hosting this running
shimazu
2017/06/16 04:18:43
Done.
|
| + base::WeakPtr<ServiceWorkerProviderHost> provider_host_; |
| + |
| // Whether devtools is attached or not. |
| bool devtools_attached_; |