Chromium Code Reviews| 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 1c33fed8ef20fc79c6eb776c4b6ee5b057994dd5..3c1aa4b1c53fc58904ca853e711a950d82af65fd 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); |
| pending_events_.insert(event); |
| - worker_global_scope_->GetThread()->PostTask( |
| - BLINK_FROM_HERE, |
| - WTF::Bind(&WorkerEventQueue::DispatchEvent, WrapPersistent(this), |
| - WrapWeakPersistent(event))); |
| + // TODO(nhiroki): Callers of enqueueEvent() should specify the task type. |
|
kinuko
2017/04/17 05:01:11
Currently window-side consumer of this class, e.g.
kinuko
2017/04/17 05:01:11
nit: enqueueEvent -> EnqueueEvent now
nhiroki
2017/04/17 11:03:46
Sounds reasonable. Added comments and changed the
|
| + TaskRunnerHelper::Get(TaskType::kMiscPlatformAPI, worker_global_scope_.Get()) |
| + ->PostTask(BLINK_FROM_HERE, |
| + WTF::Bind(&WorkerEventQueue::DispatchEvent, |
| + WrapPersistent(this), WrapWeakPersistent(event))); |
| return true; |
| } |