| 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 #ifndef CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_ |
| 6 #define CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_ | 6 #define CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/atomicops.h" | 8 #include "base/atomicops.h" |
| 9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
| 10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); | 22 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); |
| 23 ~RendererSchedulerImpl() override; | 23 ~RendererSchedulerImpl() override; |
| 24 | 24 |
| 25 // RendererScheduler implementation: | 25 // RendererScheduler implementation: |
| 26 scoped_refptr<base::SingleThreadTaskRunner> DefaultTaskRunner() override; | 26 scoped_refptr<base::SingleThreadTaskRunner> DefaultTaskRunner() override; |
| 27 scoped_refptr<base::SingleThreadTaskRunner> CompositorTaskRunner() override; | 27 scoped_refptr<base::SingleThreadTaskRunner> CompositorTaskRunner() override; |
| 28 scoped_refptr<SingleThreadIdleTaskRunner> IdleTaskRunner() override; | 28 scoped_refptr<SingleThreadIdleTaskRunner> IdleTaskRunner() override; |
| 29 void WillBeginFrame(const cc::BeginFrameArgs& args) override; | 29 void WillBeginFrame(const cc::BeginFrameArgs& args) override; |
| 30 void DidCommitFrameToCompositor() override; | 30 void DidCommitFrameToCompositor() override; |
| 31 void DidReceiveInputEventOnCompositorThread() override; | 31 void DidReceiveInputEventOnCompositorThread() override; |
| 32 void DidAnimateForInputOnCompositorThread() override; |
| 32 bool ShouldYieldForHighPriorityWork() override; | 33 bool ShouldYieldForHighPriorityWork() override; |
| 33 void Shutdown() override; | 34 void Shutdown() override; |
| 34 | 35 |
| 35 protected: | 36 protected: |
| 36 // Virtual for testing. | 37 // Virtual for testing. |
| 37 virtual base::TimeTicks Now() const; | 38 virtual base::TimeTicks Now() const; |
| 38 | 39 |
| 39 private: | 40 private: |
| 40 friend class RendererSchedulerImplTest; | 41 friend class RendererSchedulerImplTest; |
| 41 | 42 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // Posts a call to UpdatePolicy on the control runner to be run after |delay| | 85 // Posts a call to UpdatePolicy on the control runner to be run after |delay| |
| 85 void PostUpdatePolicyOnControlRunner(base::TimeDelta delay); | 86 void PostUpdatePolicyOnControlRunner(base::TimeDelta delay); |
| 86 | 87 |
| 87 // Update the policy if a new signal has arrived. Must be called from the main | 88 // Update the policy if a new signal has arrived. Must be called from the main |
| 88 // thread. | 89 // thread. |
| 89 void MaybeUpdatePolicy(); | 90 void MaybeUpdatePolicy(); |
| 90 | 91 |
| 91 // Updates the scheduler policy. Must be called from the main thread. | 92 // Updates the scheduler policy. Must be called from the main thread. |
| 92 void UpdatePolicy(); | 93 void UpdatePolicy(); |
| 93 | 94 |
| 95 // An input event of some sort happened, the policy may need updating. |
| 96 void UpdateForInputEvent(); |
| 97 |
| 94 // Start and end an idle period. | 98 // Start and end an idle period. |
| 95 void StartIdlePeriod(); | 99 void StartIdlePeriod(); |
| 96 void EndIdlePeriod(); | 100 void EndIdlePeriod(); |
| 97 | 101 |
| 98 base::ThreadChecker main_thread_checker_; | 102 base::ThreadChecker main_thread_checker_; |
| 99 scoped_ptr<RendererTaskQueueSelector> renderer_task_queue_selector_; | 103 scoped_ptr<RendererTaskQueueSelector> renderer_task_queue_selector_; |
| 100 scoped_ptr<TaskQueueManager> task_queue_manager_; | 104 scoped_ptr<TaskQueueManager> task_queue_manager_; |
| 101 scoped_refptr<base::SingleThreadTaskRunner> control_task_runner_; | 105 scoped_refptr<base::SingleThreadTaskRunner> control_task_runner_; |
| 102 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_; | 106 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_; |
| 103 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; | 107 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 119 | 123 |
| 120 base::WeakPtr<RendererSchedulerImpl> weak_renderer_scheduler_ptr_; | 124 base::WeakPtr<RendererSchedulerImpl> weak_renderer_scheduler_ptr_; |
| 121 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; | 125 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; |
| 122 | 126 |
| 123 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); | 127 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); |
| 124 }; | 128 }; |
| 125 | 129 |
| 126 } // namespace content | 130 } // namespace content |
| 127 | 131 |
| 128 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_ | 132 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_ |
| OLD | NEW |