Chromium Code Reviews| Index: third_party/WebKit/Source/platform/scheduler/child/idle_helper.cc |
| diff --git a/third_party/WebKit/Source/platform/scheduler/child/idle_helper.cc b/third_party/WebKit/Source/platform/scheduler/child/idle_helper.cc |
| index d9a946e874448d73630a128a18852d6d463418c6..2582614b8b61990827d4a95e2ed5cf94d40d3a4e 100644 |
| --- a/third_party/WebKit/Source/platform/scheduler/child/idle_helper.cc |
| +++ b/third_party/WebKit/Source/platform/scheduler/child/idle_helper.cc |
| @@ -47,7 +47,7 @@ IdleHelper::IdleHelper( |
| idle_task_runner_ = make_scoped_refptr( |
| new SingleThreadIdleTaskRunner(idle_queue_, this, tracing_category)); |
| - idle_queue_->SetQueueEnabled(false); |
| + idle_queue_->InsertFence(TaskQueue::InsertFencePosition::BEGINNING_OF_TIME); |
|
alex clarke (OOO till 29th)
2016/11/25 16:20:49
Please add a comment explaining this blocks any id
altimin
2016/11/25 16:59:25
Done.
|
| idle_queue_->SetQueuePriority(TaskQueue::BEST_EFFORT_PRIORITY); |
| helper_->AddTaskObserver(this); |
| @@ -184,10 +184,9 @@ void IdleHelper::StartIdlePeriod(IdlePeriodState new_state, |
| } |
| TRACE_EVENT0(disabled_by_default_tracing_category_, "StartIdlePeriod"); |
| - idle_queue_->SetQueueEnabled(true); |
| // Use a fence to make sure any idle tasks posted after this point do not run |
| - // until the next idle period. |
| - idle_queue_->InsertFence(); |
| + // until the next idle period and unblock existing tasks. |
| + idle_queue_->InsertFence(TaskQueue::InsertFencePosition::NOW); |
| state_.UpdateState(new_state, idle_period_deadline, now); |
| } |
| @@ -206,7 +205,7 @@ void IdleHelper::EndIdlePeriod() { |
| if (!IsInIdlePeriod(state_.idle_period_state())) |
| return; |
| - idle_queue_->SetQueueEnabled(false); |
| + idle_queue_->InsertFence(TaskQueue::InsertFencePosition::BEGINNING_OF_TIME); |
|
alex clarke (OOO till 29th)
2016/11/25 16:20:49
Please add a comment explaining this blocks any id
altimin
2016/11/25 16:59:26
Done.
|
| state_.UpdateState(IdlePeriodState::NOT_IN_IDLE_PERIOD, base::TimeTicks(), |
| base::TimeTicks()); |
| } |