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

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

Issue 2806623004: Worker: Introduce per-global-scope task scheduler (Closed)
Patch Set: remove unnecessary comments 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 65856875fad4c75b2283a1b7463106faf7ee2ac7..322045ff9d0d74ff9a424546656b0cdee47509eb 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"
@@ -18,7 +19,7 @@ namespace blink {
WorkerOrWorkletGlobalScope::WorkerOrWorkletGlobalScope()
: deprecation_warning_bits_(UseCounter::kNumberOfFeatures) {}
-WorkerOrWorkletGlobalScope::~WorkerOrWorkletGlobalScope() {}
+WorkerOrWorkletGlobalScope::~WorkerOrWorkletGlobalScope() = default;
void WorkerOrWorkletGlobalScope::AddDeprecationMessage(
UseCounter::Feature feature) {
@@ -37,7 +38,7 @@ void WorkerOrWorkletGlobalScope::AddDeprecationMessage(
}
void WorkerOrWorkletGlobalScope::PostTask(
- TaskType,
+ TaskType type,
const WebTraceLocation& location,
std::unique_ptr<ExecutionContextTask> task,
const String& task_name_for_instrumentation) {
@@ -49,10 +50,11 @@ void WorkerOrWorkletGlobalScope::PostTask(
probe::AsyncTaskScheduled(this, "Worker task", task.get());
}
- GetThread()->PostTask(
- location, CrossThreadBind(&WorkerOrWorkletGlobalScope::RunTask,
- WrapCrossThreadWeakPersistent(this),
- WTF::Passed(std::move(task)), is_instrumented));
+ TaskRunnerHelper::Get(type, this)
+ ->PostTask(location, CrossThreadBind(&WorkerOrWorkletGlobalScope::RunTask,
+ WrapCrossThreadWeakPersistent(this),
+ WTF::Passed(std::move(task)),
+ is_instrumented));
}
void WorkerOrWorkletGlobalScope::RunTask(
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp ('k') | third_party/WebKit/Source/core/workers/WorkerThread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698