Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Unified Diff: third_party/WebKit/Source/core/workers/WorkerThread.cpp

Issue 2054703003: Worker: Remove unnecessary indirection on WorkerThread::postTask() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@avoid_debugger_task
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerThread.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerThread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698