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

Unified Diff: third_party/WebKit/Source/web/WebSharedWorkerImpl.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
« no previous file with comments | « third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9f0e0963d6edaa02f0cde45b4c88bd069791d8ba..1f87bc26c29d592380909710fa12cafb802856be 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());
- worker_thread_->PostTask(location, std::move(task));
+ TaskRunnerHelper::Get(TaskType::kNetworking, GetWorkerThread())
+ ->PostTask(location, std::move(task));
}
ThreadableLoadingContext* WebSharedWorkerImpl::GetThreadableLoadingContext() {
@@ -268,11 +270,12 @@ ThreadableLoadingContext* WebSharedWorkerImpl::GetThreadableLoadingContext() {
void WebSharedWorkerImpl::Connect(
std::unique_ptr<WebMessagePortChannel> web_channel) {
DCHECK(IsMainThread());
- GetWorkerThread()->PostTask(
- BLINK_FROM_HERE,
- CrossThreadBind(&WebSharedWorkerImpl::ConnectTaskOnWorkerThread,
- WTF::CrossThreadUnretained(this),
- WTF::Passed(std::move(web_channel))));
+ TaskRunnerHelper::Get(TaskType::kDOMManipulation, GetWorkerThread())
+ ->PostTask(
+ BLINK_FROM_HERE,
+ CrossThreadBind(&WebSharedWorkerImpl::ConnectTaskOnWorkerThread,
+ WTF::CrossThreadUnretained(this),
+ WTF::Passed(std::move(web_channel))));
}
void WebSharedWorkerImpl::ConnectTaskOnWorkerThread(
« no previous file with comments | « third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698