| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/scheduler/renderer/renderer_scheduler_impl.h" | 5 #include "components/scheduler/renderer/renderer_scheduler_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "base/trace_event/trace_event_argument.h" | 10 #include "base/trace_event/trace_event_argument.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 helper_.CheckOnValidThread(); | 130 helper_.CheckOnValidThread(); |
| 131 if (helper_.IsShutdown()) | 131 if (helper_.IsShutdown()) |
| 132 return; | 132 return; |
| 133 | 133 |
| 134 base::TimeTicks now(helper_.Now()); | 134 base::TimeTicks now(helper_.Now()); |
| 135 if (now < estimated_next_frame_begin_) { | 135 if (now < estimated_next_frame_begin_) { |
| 136 // TODO(rmcilroy): Consider reducing the idle period based on the runtime of | 136 // TODO(rmcilroy): Consider reducing the idle period based on the runtime of |
| 137 // the next pending delayed tasks (as currently done in for long idle times) | 137 // the next pending delayed tasks (as currently done in for long idle times) |
| 138 idle_helper_.StartIdlePeriod( | 138 idle_helper_.StartIdlePeriod( |
| 139 IdleHelper::IdlePeriodState::IN_SHORT_IDLE_PERIOD, now, | 139 IdleHelper::IdlePeriodState::IN_SHORT_IDLE_PERIOD, now, |
| 140 estimated_next_frame_begin_, true); | 140 estimated_next_frame_begin_); |
| 141 } | 141 } |
| 142 } | 142 } |
| 143 | 143 |
| 144 void RendererSchedulerImpl::BeginFrameNotExpectedSoon() { | 144 void RendererSchedulerImpl::BeginFrameNotExpectedSoon() { |
| 145 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), | 145 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), |
| 146 "RendererSchedulerImpl::BeginFrameNotExpectedSoon"); | 146 "RendererSchedulerImpl::BeginFrameNotExpectedSoon"); |
| 147 helper_.CheckOnValidThread(); | 147 helper_.CheckOnValidThread(); |
| 148 if (helper_.IsShutdown()) | 148 if (helper_.IsShutdown()) |
| 149 return; | 149 return; |
| 150 | 150 |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 // meaningful touchstart response and should not impact task priority. | 634 // meaningful touchstart response and should not impact task priority. |
| 635 return current_state; | 635 return current_state; |
| 636 | 636 |
| 637 default: | 637 default: |
| 638 break; | 638 break; |
| 639 } | 639 } |
| 640 return InputStreamState::ACTIVE; | 640 return InputStreamState::ACTIVE; |
| 641 } | 641 } |
| 642 | 642 |
| 643 } // namespace scheduler | 643 } // namespace scheduler |
| OLD | NEW |