Chromium Code Reviews

Side by Side Diff: content/renderer/scheduler/renderer_scheduler_impl.h

Issue 692483002: Hook up DidReceiveInputEvent to the blink scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding some input event filter logic Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
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 10 matching lines...)
21 RendererSchedulerImpl( 21 RendererSchedulerImpl(
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(
32 blink::WebInputEvent::Type type) override;
33 void DidAnimateForInputOnCompositorThread() override;
32 bool ShouldYieldForHighPriorityWork() override; 34 bool ShouldYieldForHighPriorityWork() override;
33 void Shutdown() override; 35 void Shutdown() override;
34 36
35 protected: 37 protected:
36 // Virtual for testing. 38 // Virtual for testing.
37 virtual base::TimeTicks Now() const; 39 virtual base::TimeTicks Now() const;
38 40
39 private: 41 private:
40 friend class RendererSchedulerImplTest; 42 friend class RendererSchedulerImplTest;
41 43
(...skipping 42 matching lines...)
84 // Posts a call to UpdatePolicy on the control runner to be run after |delay| 86 // Posts a call to UpdatePolicy on the control runner to be run after |delay|
85 void PostUpdatePolicyOnControlRunner(base::TimeDelta delay); 87 void PostUpdatePolicyOnControlRunner(base::TimeDelta delay);
86 88
87 // Update the policy if a new signal has arrived. Must be called from the main 89 // Update the policy if a new signal has arrived. Must be called from the main
88 // thread. 90 // thread.
89 void MaybeUpdatePolicy(); 91 void MaybeUpdatePolicy();
90 92
91 // Updates the scheduler policy. Must be called from the main thread. 93 // Updates the scheduler policy. Must be called from the main thread.
92 void UpdatePolicy(); 94 void UpdatePolicy();
93 95
96 // An input event of some sort happened, the policy may need updating.
97 void UpdateForInputEvent();
98
94 // Start and end an idle period. 99 // Start and end an idle period.
95 void StartIdlePeriod(); 100 void StartIdlePeriod();
96 void EndIdlePeriod(); 101 void EndIdlePeriod();
97 102
98 base::ThreadChecker main_thread_checker_; 103 base::ThreadChecker main_thread_checker_;
99 scoped_ptr<RendererTaskQueueSelector> renderer_task_queue_selector_; 104 scoped_ptr<RendererTaskQueueSelector> renderer_task_queue_selector_;
100 scoped_ptr<TaskQueueManager> task_queue_manager_; 105 scoped_ptr<TaskQueueManager> task_queue_manager_;
101 scoped_refptr<base::SingleThreadTaskRunner> control_task_runner_; 106 scoped_refptr<base::SingleThreadTaskRunner> control_task_runner_;
102 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_; 107 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_;
103 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; 108 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
(...skipping 15 matching lines...)
119 124
120 base::WeakPtr<RendererSchedulerImpl> weak_renderer_scheduler_ptr_; 125 base::WeakPtr<RendererSchedulerImpl> weak_renderer_scheduler_ptr_;
121 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; 126 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_;
122 127
123 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); 128 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl);
124 }; 129 };
125 130
126 } // namespace content 131 } // namespace content
127 132
128 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_ 133 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_
OLDNEW
« no previous file with comments | « content/renderer/scheduler/renderer_scheduler.h ('k') | content/renderer/scheduler/renderer_scheduler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine