| 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 "platform/scheduler/renderer/renderer_scheduler_impl.h" | 5 #include "platform/scheduler/renderer/renderer_scheduler_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/stack_trace.h" | 8 #include "base/debug/stack_trace.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 | 838 |
| 839 base::TimeTicks RendererSchedulerImpl::CurrentIdleTaskDeadlineForTesting() | 839 base::TimeTicks RendererSchedulerImpl::CurrentIdleTaskDeadlineForTesting() |
| 840 const { | 840 const { |
| 841 return idle_helper_.CurrentIdleTaskDeadline(); | 841 return idle_helper_.CurrentIdleTaskDeadline(); |
| 842 } | 842 } |
| 843 | 843 |
| 844 void RendererSchedulerImpl::RunIdleTasksForTesting( | 844 void RendererSchedulerImpl::RunIdleTasksForTesting( |
| 845 const base::Closure& callback) { | 845 const base::Closure& callback) { |
| 846 MainThreadOnly().in_idle_period_for_testing = true; | 846 MainThreadOnly().in_idle_period_for_testing = true; |
| 847 IdleTaskRunner()->PostIdleTask( | 847 IdleTaskRunner()->PostIdleTask( |
| 848 FROM_HERE, base::Bind(&RendererSchedulerImpl::EndIdlePeriodForTesting, | 848 FROM_HERE, |
| 849 weak_factory_.GetWeakPtr(), callback)); | 849 base::Bind(&RendererSchedulerImpl::EndIdlePeriodForTesting, |
| 850 weak_factory_.GetWeakPtr(), callback)); |
| 850 idle_helper_.EnableLongIdlePeriod(); | 851 idle_helper_.EnableLongIdlePeriod(); |
| 851 } | 852 } |
| 852 | 853 |
| 853 void RendererSchedulerImpl::MaybeUpdatePolicy() { | 854 void RendererSchedulerImpl::MaybeUpdatePolicy() { |
| 854 helper_.CheckOnValidThread(); | 855 helper_.CheckOnValidThread(); |
| 855 if (policy_may_need_update_.IsSet()) { | 856 if (policy_may_need_update_.IsSet()) { |
| 856 UpdatePolicy(); | 857 UpdatePolicy(); |
| 857 } | 858 } |
| 858 } | 859 } |
| 859 | 860 |
| (...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1894 case TimeDomainType::VIRTUAL: | 1895 case TimeDomainType::VIRTUAL: |
| 1895 return "virtual"; | 1896 return "virtual"; |
| 1896 default: | 1897 default: |
| 1897 NOTREACHED(); | 1898 NOTREACHED(); |
| 1898 return nullptr; | 1899 return nullptr; |
| 1899 } | 1900 } |
| 1900 } | 1901 } |
| 1901 | 1902 |
| 1902 } // namespace scheduler | 1903 } // namespace scheduler |
| 1903 } // namespace blink | 1904 } // namespace blink |
| OLD | NEW |