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

Unified Diff: third_party/WebKit/Source/web/WebSharedWorkerImpl.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/web/WebSharedWorkerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
index 6726bb88fc5495779932c70d85a6eccc023439c9..38d705ee77ffc3dde08a14a00bb8e8e84b9fd36f 100644
--- a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
@@ -32,6 +32,7 @@
#include <memory>
#include "core/dom/Document.h"
+#include "core/dom/TaskRunnerHelper.h"
#include "core/events/MessageEvent.h"
#include "core/inspector/ConsoleMessage.h"
#include "core/loader/FrameLoadRequest.h"
@@ -254,7 +255,8 @@ void WebSharedWorkerImpl::postTaskToWorkerGlobalScope(
const WebTraceLocation& location,
std::unique_ptr<WTF::CrossThreadClosure> task) {
DCHECK(isMainThread());
- m_workerThread->postTask(location, std::move(task));
+ TaskRunnerHelper::get(TaskType::Networking, m_workerThread.get())
+ ->postTask(location, std::move(task));
}
ThreadableLoadingContext* WebSharedWorkerImpl::getThreadableLoadingContext() {
@@ -268,11 +270,12 @@ ThreadableLoadingContext* WebSharedWorkerImpl::getThreadableLoadingContext() {
void WebSharedWorkerImpl::connect(
std::unique_ptr<WebMessagePortChannel> webChannel) {
DCHECK(isMainThread());
- workerThread()->postTask(
- BLINK_FROM_HERE,
- crossThreadBind(&WebSharedWorkerImpl::connectTaskOnWorkerThread,
- WTF::crossThreadUnretained(this),
- WTF::passed(std::move(webChannel))));
+ TaskRunnerHelper::get(TaskType::DOMManipulation, workerThread())
+ ->postTask(
+ BLINK_FROM_HERE,
+ crossThreadBind(&WebSharedWorkerImpl::connectTaskOnWorkerThread,
+ WTF::crossThreadUnretained(this),
+ WTF::passed(std::move(webChannel))));
}
void WebSharedWorkerImpl::connectTaskOnWorkerThread(

Powered by Google App Engine
This is Rietveld 408576698