Chromium Code Reviews| Index: content/renderer/service_worker/embedded_worker_context_client.cc |
| diff --git a/content/renderer/service_worker/embedded_worker_context_client.cc b/content/renderer/service_worker/embedded_worker_context_client.cc |
| index 2173cedeb59ad6dd5433434a5c31fe09509b1f12..1559a38fa52342ec2d726e472a6f69307c10a3b6 100644 |
| --- a/content/renderer/service_worker/embedded_worker_context_client.cc |
| +++ b/content/renderer/service_worker/embedded_worker_context_client.cc |
| @@ -208,13 +208,6 @@ void EmbeddedWorkerContextClient::workerContextStarted( |
| WorkerTaskRunner::Instance()->CurrentWorkerId(), |
| provider_context_->provider_id())); |
| - // Schedule a task to send back WorkerStarted asynchronously, |
| - // so that at the time we send it we can be sure that the worker |
| - // script has been evaluated and worker run loop has been started. |
| - worker_task_runner_->PostTask( |
| - FROM_HERE, |
| - base::Bind(&EmbeddedWorkerContextClient::SendWorkerStarted, |
| - weak_factory_.GetWeakPtr())); |
| TRACE_EVENT_ASYNC_STEP_INTO0( |
| "ServiceWorker", |
| "EmbeddedWorkerContextClient::StartingWorkerContext", |
| @@ -225,6 +218,13 @@ void EmbeddedWorkerContextClient::workerContextStarted( |
| void EmbeddedWorkerContextClient::didEvaluateWorkerScript(bool success) { |
| Send(new EmbeddedWorkerHostMsg_WorkerScriptEvaluated( |
| embedded_worker_id_, success)); |
| + |
| + // Schedule a task to send back WorkerStarted asynchronously, |
| + // so that at the time we send it we can be sure that the |
| + // worker run loop has been started. |
| + worker_task_runner_->PostTask( |
| + FROM_HERE, base::Bind(&EmbeddedWorkerContextClient::SendWorkerStarted, |
| + weak_factory_.GetWeakPtr())); |
|
kinuko
2015/03/02 03:19:33
Did you need to move this method? Could you explai
falken
2015/03/02 04:19:17
It's just a cleanup. It was pretty confusing to re
kinuko
2015/03/02 06:13:19
I see. We probably don't need to call the SendWork
falken
2015/03/02 06:33:16
Yes I think the only reason we'd send async is if
|
| } |
| void EmbeddedWorkerContextClient::willDestroyWorkerContext() { |