| Index: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
|
| diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
|
| index fee7f311ab1eb2885fe4cf5c7f51be0844a82e76..742f845ba65bda18adc3e1ffe093d88567620901 100644
|
| --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
|
| +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
|
| @@ -803,6 +803,17 @@ void TaskQueueImpl::EnableOrDisableWithSelector(bool enable) {
|
| return;
|
|
|
| if (enable) {
|
| + // Check if there's any immediate work on either queue.
|
| + bool immediate_queues_empty =
|
| + main_thread_only().immediate_work_queue->Empty();
|
| + if (immediate_queues_empty) {
|
| + base::AutoLock lock(any_thread_lock_);
|
| + immediate_queues_empty = any_thread().immediate_incoming_queue.empty();
|
| + }
|
| + // Avoid holding the lock while we fire the notification.
|
| + if (!immediate_queues_empty)
|
| + main_thread_only().time_domain->OnQueueHasImmediateWork(this);
|
| +
|
| if (!main_thread_only().delayed_incoming_queue.empty()) {
|
| main_thread_only().time_domain->ScheduleDelayedWork(
|
| this,
|
|
|