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..49090ebda18eae8b8db1ad7eb199f1e35c17c6a4 100644 |
| --- a/content/browser/service_worker/embedded_worker_instance.h |
| +++ b/content/browser/service_worker/embedded_worker_instance.h |
| @@ -71,6 +71,10 @@ class CONTENT_EXPORT EmbeddedWorkerInstance |
| STARTING_PHASE_MAX_VALUE, |
| }; |
| + using ProviderClientInfoGetter = |
| + base::OnceCallback<mojom::ServiceWorkerProviderInfoForStartWorkerPtr( |
| + int)>; |
|
falken
2017/06/19 07:50:40
Rername to ProviderInfoGetter
int /* process_id *
shimazu
2017/06/19 10:41:25
Done.
|
| + |
| class Listener { |
| public: |
| virtual ~Listener() {} |
| @@ -108,8 +112,10 @@ class CONTENT_EXPORT EmbeddedWorkerInstance |
| // STOPPED status. |callback| is invoked after the worker script has been |
| // started and evaluated, or when an error occurs. |
| // |params| should be populated with service worker version info needed |
| - // to start the worker. |
| + // to start the worker. |provider_client_info_getter| will be used when this |
|
falken
2017/06/19 07:50:40
"|provider_info_getter| is called when this instan
shimazu
2017/06/19 10:41:25
Done.
|
| + // instance allocates a process and is ready to send a StartWorker message. |
| void Start(std::unique_ptr<EmbeddedWorkerStartParams> params, |
| + ProviderClientInfoGetter provider_client_info_getter, |
|
falken
2017/06/19 07:50:40
Rename to provider_info_getter
shimazu
2017/06/19 10:41:25
Done.
|
| mojom::ServiceWorkerEventDispatcherRequest dispatcher_request, |
| const StatusCallback& callback); |
| @@ -228,7 +234,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 +289,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 +302,9 @@ class CONTENT_EXPORT EmbeddedWorkerInstance |
| // a mojo struct. |
| mojom::ServiceWorkerEventDispatcherRequest pending_dispatcher_request_; |
| + // This is set at Start and used on SendStartWorker. |
| + ProviderClientInfoGetter provider_client_info_getter_; |
|
falken
2017/06/19 07:50:40
ProviderInfoGetter provider_info_getter
shimazu
2017/06/19 10:41:25
Done.
|
| + |
| // Whether devtools is attached or not. |
| bool devtools_attached_; |