| Index: third_party/WebKit/Source/core/workers/WorkerThread.cpp
|
| diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.cpp b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
|
| index 49d1965e8657fd2736ad8a928465716d4cc93b8d..4b3f80161dc1fffdcc217c9c22c9ee9028bd95f3 100644
|
| --- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
|
| +++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
|
| @@ -225,7 +225,13 @@ void WorkerThread::postTask(const WebTraceLocation& location, std::unique_ptr<Ex
|
| if (m_terminated || m_readyToShutdown)
|
| return;
|
| }
|
| - workerBackingThread().backingThread().postTask(location, createWorkerThreadTask(std::move(task), true));
|
| +
|
| + bool isInstrumented = !task->taskNameForInstrumentation().isEmpty();
|
| + if (isInstrumented) {
|
| + DCHECK(isCurrentThread());
|
| + InspectorInstrumentation::asyncTaskScheduled(workerGlobalScope(), "Worker task", task.get());
|
| + }
|
| + workerBackingThread().backingThread().postTask(location, threadSafeBind(&WorkerThread::performTaskOnWorkerThread, AllowCrossThreadAccess(this), passed(std::move(task)), isInstrumented));
|
| }
|
|
|
| void WorkerThread::appendDebuggerTask(std::unique_ptr<CrossThreadClosure> task)
|
| @@ -310,17 +316,6 @@ WorkerThread::WorkerThread(PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, Work
|
| workerThreads().add(this);
|
| }
|
|
|
| -std::unique_ptr<CrossThreadClosure> WorkerThread::createWorkerThreadTask(std::unique_ptr<ExecutionContextTask> task, bool isInstrumented)
|
| -{
|
| - if (isInstrumented)
|
| - isInstrumented = !task->taskNameForInstrumentation().isEmpty();
|
| - if (isInstrumented) {
|
| - DCHECK(isCurrentThread());
|
| - InspectorInstrumentation::asyncTaskScheduled(workerGlobalScope(), "Worker task", task.get());
|
| - }
|
| - return threadSafeBind(&WorkerThread::performTaskOnWorkerThread, AllowCrossThreadAccess(this), passed(std::move(task)), isInstrumented);
|
| -}
|
| -
|
| void WorkerThread::terminateInternal(TerminationMode mode)
|
| {
|
| DCHECK(m_started);
|
|
|