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..e6a3c08f4ceaa151016d0773ad7bd54ee2af3dea 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,16 @@ 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))); |
| + // This queue is unthrottled because throttling event tasks may break existing |
| + // web pages. For example, throttling IndexedDB events may break scenarios |
| + // where several tabs, some of which are backgrounded, access the same |
| + // database concurrently. See also comments in the ctor of |
| + // DOMWindowEventQueueTimer. |
| + // TODO(nhiroki): Callers of enqueueEvent() should specify the task type. |
| + TaskRunnerHelper::Get(TaskType::kUnthrottled, worker_global_scope_.Get()) |
| + ->PostTask(BLINK_FROM_HERE, |
| + WTF::Bind(&WorkerEventQueue::DispatchEvent, |
| + WrapPersistent(this), WrapWeakPersistent(event))); |
|
haraken
2017/04/17 14:49:52
Not related to this CL, do you know why we're usin
nhiroki
2017/04/18 05:34:38
It was introduced by https://codereview.chromium.o
|
| return true; |
| } |