| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 base::TimeTicks IdleHelper::CurrentIdleTaskDeadline() const { | 281 base::TimeTicks IdleHelper::CurrentIdleTaskDeadline() const { |
| 282 helper_->CheckOnValidThread(); | 282 helper_->CheckOnValidThread(); |
| 283 return state_.idle_period_deadline(); | 283 return state_.idle_period_deadline(); |
| 284 } | 284 } |
| 285 | 285 |
| 286 void IdleHelper::OnIdleTaskPosted() { | 286 void IdleHelper::OnIdleTaskPosted() { |
| 287 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), | 287 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), |
| 288 "OnIdleTaskPosted"); | 288 "OnIdleTaskPosted"); |
| 289 if (is_shutdown_) | 289 if (is_shutdown_) |
| 290 return; | 290 return; |
| 291 if (idle_task_runner_->RunsTasksOnCurrentThread()) { | 291 if (idle_task_runner_->RunsTasksInCurrentSequence()) { |
| 292 OnIdleTaskPostedOnMainThread(); | 292 OnIdleTaskPostedOnMainThread(); |
| 293 } else { | 293 } else { |
| 294 helper_->ControlTaskQueue()->PostTask( | 294 helper_->ControlTaskQueue()->PostTask( |
| 295 FROM_HERE, on_idle_task_posted_closure_.GetCallback()); | 295 FROM_HERE, on_idle_task_posted_closure_.GetCallback()); |
| 296 } | 296 } |
| 297 } | 297 } |
| 298 | 298 |
| 299 void IdleHelper::OnIdleTaskPostedOnMainThread() { | 299 void IdleHelper::OnIdleTaskPostedOnMainThread() { |
| 300 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), | 300 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), |
| 301 "OnIdleTaskPostedOnMainThread"); | 301 "OnIdleTaskPostedOnMainThread"); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 case IdlePeriodState::IN_LONG_IDLE_PERIOD_PAUSED: | 504 case IdlePeriodState::IN_LONG_IDLE_PERIOD_PAUSED: |
| 505 return "in_long_idle_period_paused"; | 505 return "in_long_idle_period_paused"; |
| 506 default: | 506 default: |
| 507 NOTREACHED(); | 507 NOTREACHED(); |
| 508 return nullptr; | 508 return nullptr; |
| 509 } | 509 } |
| 510 } | 510 } |
| 511 | 511 |
| 512 } // namespace scheduler | 512 } // namespace scheduler |
| 513 } // namespace blink | 513 } // namespace blink |
| OLD | NEW |