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

Unified Diff: third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.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/InProcessWorkerMessagingProxy.cpp
diff --git a/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp b/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
index bc0a6f1b63f17fd8c202be97cba07254fefc7c8c..5b3a4ce641a1d93632c44a5a0d16d25e57fac4c0 100644
--- a/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
+++ b/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
@@ -30,6 +30,7 @@
#include <memory>
#include "core/dom/Document.h"
#include "core/dom/SecurityContext.h"
+#include "core/dom/TaskRunnerHelper.h"
#include "core/events/ErrorEvent.h"
#include "core/events/MessageEvent.h"
#include "core/frame/LocalFrame.h"
@@ -148,7 +149,8 @@ void InProcessWorkerMessagingProxy::PostMessageToWorkerGlobalScope(
CrossThreadUnretained(&WorkerObjectProxy()), std::move(message),
WTF::Passed(std::move(channels)),
CrossThreadUnretained(GetWorkerThread()));
- GetWorkerThread()->PostTask(BLINK_FROM_HERE, std::move(task));
+ TaskRunnerHelper::Get(TaskType::kPostedMessage, GetWorkerThread())
+ ->PostTask(BLINK_FROM_HERE, std::move(task));
} else {
queued_early_tasks_.push_back(
QueuedTask{std::move(message), std::move(channels)});
@@ -197,7 +199,8 @@ void InProcessWorkerMessagingProxy::WorkerThreadCreated() {
queued_task.message.Release(),
WTF::Passed(std::move(queued_task.channels)),
CrossThreadUnretained(GetWorkerThread()));
- GetWorkerThread()->PostTask(BLINK_FROM_HERE, std::move(task));
+ TaskRunnerHelper::Get(TaskType::kPostedMessage, GetWorkerThread())
+ ->PostTask(BLINK_FROM_HERE, std::move(task));
}
queued_early_tasks_.Clear();
}

Powered by Google App Engine
This is Rietveld 408576698