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

Unified Diff: third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.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/InProcessWorkerMessagingProxy.cpp
diff --git a/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp b/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
index ade6bfe80569dacf8486ee94c9e9cd0af9884f93..1077edd1323c327c93c0fe362ffcf0601fff1aee 100644
--- a/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
+++ b/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
@@ -27,8 +27,10 @@
#include "core/workers/InProcessWorkerMessagingProxy.h"
+#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"
@@ -45,7 +47,6 @@
#include "platform/CrossThreadFunctional.h"
#include "platform/WebTaskRunner.h"
#include "wtf/WTF.h"
-#include <memory>
namespace blink {
@@ -148,7 +149,8 @@ void InProcessWorkerMessagingProxy::postMessageToWorkerGlobalScope(
crossThreadUnretained(&workerObjectProxy()), std::move(message),
WTF::passed(std::move(channels)),
crossThreadUnretained(workerThread()));
- workerThread()->postTask(BLINK_FROM_HERE, std::move(task));
+ TaskRunnerHelper::get(TaskType::PostedMessage, workerThread())
+ ->postTask(BLINK_FROM_HERE, std::move(task));
} else {
m_queuedEarlyTasks.push_back(
QueuedTask{std::move(message), std::move(channels)});
@@ -197,7 +199,8 @@ void InProcessWorkerMessagingProxy::workerThreadCreated() {
queuedTask.message.release(),
WTF::passed(std::move(queuedTask.channels)),
crossThreadUnretained(workerThread()));
- workerThread()->postTask(BLINK_FROM_HERE, std::move(task));
+ TaskRunnerHelper::get(TaskType::PostedMessage, workerThread())
+ ->postTask(BLINK_FROM_HERE, std::move(task));
}
m_queuedEarlyTasks.clear();
}

Powered by Google App Engine
This is Rietveld 408576698