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

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

Issue 2642113002: Worker: Reduce use of ExecutionContextTask in core/workers (Closed)
Patch Set: fix build failures Created 3 years, 11 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
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 e7fc19667491f56cbe8d7dc31a4de7639f34bee3..12efbdd58b1ef6f3b9036a9e83bd9988655bba43 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
@@ -190,7 +190,7 @@ bool WorkerThread::isCurrentThread() {
}
void WorkerThread::postTask(const WebTraceLocation& location,
- std::unique_ptr<ExecutionContextTask> task) {
+ std::unique_ptr<WTF::CrossThreadClosure> task) {
if (isInShutdown())
return;
workerBackingThread().backingThread().postTask(
@@ -199,13 +199,6 @@ void WorkerThread::postTask(const WebTraceLocation& location,
WTF::passed(std::move(task))));
}
-void WorkerThread::postTask(const WebTraceLocation& location,
- std::unique_ptr<WTF::CrossThreadClosure> task) {
- std::unique_ptr<ExecutionContextTask> wrappedTask = createCrossThreadTask(
- &WTF::CrossThreadClosure::operator(), WTF::passed(std::move(task)));
- postTask(location, std::move(wrappedTask));
-}
-
void WorkerThread::appendDebuggerTask(
std::unique_ptr<CrossThreadClosure> task) {
DCHECK(isMainThread());
@@ -565,7 +558,7 @@ void WorkerThread::performShutdownOnWorkerThread() {
}
void WorkerThread::performTaskOnWorkerThread(
- std::unique_ptr<ExecutionContextTask> task) {
+ std::unique_ptr<WTF::CrossThreadClosure> task) {
DCHECK(isCurrentThread());
if (m_threadState != ThreadState::Running)
return;
@@ -575,7 +568,7 @@ void WorkerThread::performTaskOnWorkerThread(
CustomCountHistogram, scopedUsCounter,
new CustomCountHistogram("WorkerThread.Task.Time", 0, 10000000, 50));
ScopedUsHistogramTimer timer(scopedUsCounter);
- task->performTask(globalScope());
+ (*task)();
}
}
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerThread.h ('k') | third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698