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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerEventQueue.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/WorkerEventQueue.cpp
diff --git a/third_party/WebKit/Source/core/workers/WorkerEventQueue.cpp b/third_party/WebKit/Source/core/workers/WorkerEventQueue.cpp
index de9b2d7290cfac72a4c81af035c11e963bc65a22..ee47da55f63f61dfd739361b24a07b0bf25a55f8 100644
--- a/third_party/WebKit/Source/core/workers/WorkerEventQueue.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerEventQueue.cpp
@@ -26,6 +26,7 @@
#include "core/workers/WorkerEventQueue.h"
+#include "core/dom/TaskRunnerHelper.h"
#include "core/events/Event.h"
#include "core/probe/CoreProbes.h"
#include "core/workers/WorkerGlobalScope.h"
@@ -57,10 +58,11 @@ bool WorkerEventQueue::enqueueEvent(Event* event) {
probe::asyncTaskScheduled(event->target()->getExecutionContext(),
event->type(), event);
m_pendingEvents.insert(event);
- m_workerGlobalScope->thread()->postTask(
- BLINK_FROM_HERE,
- WTF::bind(&WorkerEventQueue::dispatchEvent, wrapPersistent(this),
- wrapWeakPersistent(event)));
+ // TODO(nhiroki): Callers of enqueueEvent() should specify the task type.
+ TaskRunnerHelper::get(TaskType::MiscPlatformAPI, m_workerGlobalScope.get())
+ ->postTask(BLINK_FROM_HERE,
+ WTF::bind(&WorkerEventQueue::dispatchEvent,
+ wrapPersistent(this), wrapWeakPersistent(event)));
return true;
}

Powered by Google App Engine
This is Rietveld 408576698