| 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 "content/renderer/scheduler/renderer_scheduler_impl.h" | 5 #include "content/renderer/scheduler/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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 MaybeUpdatePolicy(); | 478 MaybeUpdatePolicy(); |
| 479 if (SchedulerPolicy() == Policy::TOUCHSTART_PRIORITY) { | 479 if (SchedulerPolicy() == Policy::TOUCHSTART_PRIORITY) { |
| 480 // Don't start a long idle task in touch start priority, try again when | 480 // Don't start a long idle task in touch start priority, try again when |
| 481 // the policy is scheduled to end. | 481 // the policy is scheduled to end. |
| 482 *next_long_idle_period_delay_out = current_policy_expiration_time_ - now; | 482 *next_long_idle_period_delay_out = current_policy_expiration_time_ - now; |
| 483 return false; | 483 return false; |
| 484 } | 484 } |
| 485 return true; | 485 return true; |
| 486 } | 486 } |
| 487 | 487 |
| 488 void RendererSchedulerImpl::SetTimeSourceForTesting( | 488 SchedulerHelper* RendererSchedulerImpl::GetSchedulerHelperForTesting() { |
| 489 scoped_refptr<cc::TestNowSource> time_source) { | 489 return &helper_; |
| 490 helper_.SetTimeSourceForTesting(time_source); | |
| 491 } | 490 } |
| 492 | 491 |
| 493 void RendererSchedulerImpl::SetWorkBatchSizeForTesting(size_t work_batch_size) { | 492 void RendererSchedulerImpl::SetWorkBatchSizeForTesting(size_t work_batch_size) { |
| 494 helper_.SetWorkBatchSizeForTesting(work_batch_size); | 493 helper_.SetWorkBatchSizeForTesting(work_batch_size); |
| 495 } | 494 } |
| 496 | 495 |
| 497 RendererSchedulerImpl::PollableNeedsUpdateFlag::PollableNeedsUpdateFlag( | 496 RendererSchedulerImpl::PollableNeedsUpdateFlag::PollableNeedsUpdateFlag( |
| 498 base::Lock* write_lock_) | 497 base::Lock* write_lock_) |
| 499 : flag_(false), write_lock_(write_lock_) { | 498 : flag_(false), write_lock_(write_lock_) { |
| 500 } | 499 } |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 // meaningful touchstart response and should not impact task priority. | 632 // meaningful touchstart response and should not impact task priority. |
| 634 return current_state; | 633 return current_state; |
| 635 | 634 |
| 636 default: | 635 default: |
| 637 break; | 636 break; |
| 638 } | 637 } |
| 639 return InputStreamState::ACTIVE; | 638 return InputStreamState::ACTIVE; |
| 640 } | 639 } |
| 641 | 640 |
| 642 } // namespace content | 641 } // namespace content |
| OLD | NEW |