| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/scheduler/child/idle_helper.h" | 5 #include "platform/scheduler/child/idle_helper.h" |
| 6 | 6 |
| 7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
| 8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
| 9 #include "base/trace_event/trace_event_argument.h" | 9 #include "base/trace_event/trace_event_argument.h" |
| 10 #include "platform/scheduler/base/real_time_domain.h" | 10 #include "platform/scheduler/base/real_time_domain.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } | 59 } |
| 60 | 60 |
| 61 void IdleHelper::Shutdown() { | 61 void IdleHelper::Shutdown() { |
| 62 if (is_shutdown_) | 62 if (is_shutdown_) |
| 63 return; | 63 return; |
| 64 | 64 |
| 65 EndIdlePeriod(); | 65 EndIdlePeriod(); |
| 66 is_shutdown_ = true; | 66 is_shutdown_ = true; |
| 67 weak_factory_.InvalidateWeakPtrs(); | 67 weak_factory_.InvalidateWeakPtrs(); |
| 68 // Belt & braces, might not be needed. | 68 // Belt & braces, might not be needed. |
| 69 idle_queue_->SetQueueEnabled(false); | 69 idle_queue_->InsertFence(TaskQueue::InsertFencePosition::BEGINNING_OF_TIME); |
| 70 helper_->RemoveTaskObserver(this); | 70 helper_->RemoveTaskObserver(this); |
| 71 } | 71 } |
| 72 | 72 |
| 73 IdleHelper::Delegate::Delegate() {} | 73 IdleHelper::Delegate::Delegate() {} |
| 74 | 74 |
| 75 IdleHelper::Delegate::~Delegate() {} | 75 IdleHelper::Delegate::~Delegate() {} |
| 76 | 76 |
| 77 scoped_refptr<SingleThreadIdleTaskRunner> IdleHelper::IdleTaskRunner() { | 77 scoped_refptr<SingleThreadIdleTaskRunner> IdleHelper::IdleTaskRunner() { |
| 78 helper_->CheckOnValidThread(); | 78 helper_->CheckOnValidThread(); |
| 79 return idle_task_runner_; | 79 return idle_task_runner_; |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 case IdlePeriodState::IN_LONG_IDLE_PERIOD_PAUSED: | 494 case IdlePeriodState::IN_LONG_IDLE_PERIOD_PAUSED: |
| 495 return "in_long_idle_period_paused"; | 495 return "in_long_idle_period_paused"; |
| 496 default: | 496 default: |
| 497 NOTREACHED(); | 497 NOTREACHED(); |
| 498 return nullptr; | 498 return nullptr; |
| 499 } | 499 } |
| 500 } | 500 } |
| 501 | 501 |
| 502 } // namespace scheduler | 502 } // namespace scheduler |
| 503 } // namespace blink | 503 } // namespace blink |
| OLD | NEW |