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

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

Issue 2806623004: Worker: Introduce per-global-scope task scheduler (Closed)
Patch Set: wip Created 3 years, 8 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/WorkerOrWorkletGlobalScope.cpp
diff --git a/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp b/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp
index 5ae838b150bbfba3784b01c9b5f45b530a90a50f..30c0598c0c19fc9730cddda8645d3b77de074663 100644
--- a/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp
@@ -5,6 +5,7 @@
#include "core/workers/WorkerOrWorkletGlobalScope.h"
#include "core/dom/ExecutionContextTask.h"
+#include "core/dom/TaskRunnerHelper.h"
#include "core/frame/Deprecation.h"
#include "core/inspector/ConsoleMessage.h"
#include "core/probe/CoreProbes.h"
@@ -37,7 +38,7 @@ void WorkerOrWorkletGlobalScope::addDeprecationMessage(
}
void WorkerOrWorkletGlobalScope::postTask(
- TaskType,
+ TaskType type,
const WebTraceLocation& location,
std::unique_ptr<ExecutionContextTask> task,
const String& taskNameForInstrumentation) {
@@ -49,10 +50,11 @@ void WorkerOrWorkletGlobalScope::postTask(
probe::asyncTaskScheduled(this, "Worker task", task.get());
}
- thread()->postTask(
- location, crossThreadBind(&WorkerOrWorkletGlobalScope::runTask,
- wrapCrossThreadWeakPersistent(this),
- WTF::passed(std::move(task)), isInstrumented));
+ TaskRunnerHelper::get(type, this)
+ ->postTask(location,
+ crossThreadBind(&WorkerOrWorkletGlobalScope::runTask,
+ wrapCrossThreadWeakPersistent(this),
+ WTF::passed(std::move(task)), isInstrumented));
}
void WorkerOrWorkletGlobalScope::runTask(

Powered by Google App Engine
This is Rietveld 408576698