Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

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

Issue 894183002: Revert of Run task queue manager work in batches (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/renderer/scheduler/renderer_scheduler_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "cc/test/test_now_source.h"
12 #include "content/renderer/scheduler/cancelable_closure_holder.h" 11 #include "content/renderer/scheduler/cancelable_closure_holder.h"
13 #include "content/renderer/scheduler/renderer_scheduler.h" 12 #include "content/renderer/scheduler/renderer_scheduler.h"
14 #include "content/renderer/scheduler/single_thread_idle_task_runner.h" 13 #include "content/renderer/scheduler/single_thread_idle_task_runner.h"
15 #include "content/renderer/scheduler/task_queue_manager.h" 14 #include "content/renderer/scheduler/task_queue_manager.h"
16 15
17 namespace base { 16 namespace base {
18 namespace debug { 17 namespace debug {
19 class ConvertableToTraceFormat; 18 class ConvertableToTraceFormat;
20 } 19 }
21 } 20 }
(...skipping 14 matching lines...) Expand all
36 scoped_refptr<SingleThreadIdleTaskRunner> IdleTaskRunner() override; 35 scoped_refptr<SingleThreadIdleTaskRunner> IdleTaskRunner() override;
37 scoped_refptr<base::SingleThreadTaskRunner> LoadingTaskRunner() override; 36 scoped_refptr<base::SingleThreadTaskRunner> LoadingTaskRunner() override;
38 void WillBeginFrame(const cc::BeginFrameArgs& args) override; 37 void WillBeginFrame(const cc::BeginFrameArgs& args) override;
39 void DidCommitFrameToCompositor() override; 38 void DidCommitFrameToCompositor() override;
40 void DidReceiveInputEventOnCompositorThread( 39 void DidReceiveInputEventOnCompositorThread(
41 blink::WebInputEvent::Type type) override; 40 blink::WebInputEvent::Type type) override;
42 void DidAnimateForInputOnCompositorThread() override; 41 void DidAnimateForInputOnCompositorThread() override;
43 bool ShouldYieldForHighPriorityWork() override; 42 bool ShouldYieldForHighPriorityWork() override;
44 void Shutdown() override; 43 void Shutdown() override;
45 44
46 void SetTimeSourceForTesting(scoped_refptr<cc::TestNowSource> time_source); 45 protected:
46 // Virtual for testing.
47 virtual base::TimeTicks Now() const;
47 48
48 private: 49 private:
49 friend class RendererSchedulerImplTest; 50 friend class RendererSchedulerImplTest;
50 51
51 // Keep RendererSchedulerImpl::TaskQueueIdToString in sync with this enum. 52 // Keep RendererSchedulerImpl::TaskQueueIdToString in sync with this enum.
52 enum QueueId { 53 enum QueueId {
53 DEFAULT_TASK_QUEUE, 54 DEFAULT_TASK_QUEUE,
54 COMPOSITOR_TASK_QUEUE, 55 COMPOSITOR_TASK_QUEUE,
55 IDLE_TASK_QUEUE, 56 IDLE_TASK_QUEUE,
56 CONTROL_TASK_QUEUE, 57 CONTROL_TASK_QUEUE,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // Updates the scheduler policy. Must be called from the main thread. 109 // Updates the scheduler policy. Must be called from the main thread.
109 void UpdatePolicy(); 110 void UpdatePolicy();
110 111
111 // An input event of some sort happened, the policy may need updating. 112 // An input event of some sort happened, the policy may need updating.
112 void UpdateForInputEvent(); 113 void UpdateForInputEvent();
113 114
114 // Start and end an idle period. 115 // Start and end an idle period.
115 void StartIdlePeriod(); 116 void StartIdlePeriod();
116 void EndIdlePeriod(); 117 void EndIdlePeriod();
117 118
118 base::TimeTicks Now() const;
119
120 base::ThreadChecker main_thread_checker_; 119 base::ThreadChecker main_thread_checker_;
121 scoped_ptr<RendererTaskQueueSelector> renderer_task_queue_selector_; 120 scoped_ptr<RendererTaskQueueSelector> renderer_task_queue_selector_;
122 scoped_ptr<TaskQueueManager> task_queue_manager_; 121 scoped_ptr<TaskQueueManager> task_queue_manager_;
123 scoped_refptr<base::SingleThreadTaskRunner> control_task_runner_; 122 scoped_refptr<base::SingleThreadTaskRunner> control_task_runner_;
124 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_; 123 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_;
125 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; 124 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
126 scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner_; 125 scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner_;
127 scoped_refptr<SingleThreadIdleTaskRunner> idle_task_runner_; 126 scoped_refptr<SingleThreadIdleTaskRunner> idle_task_runner_;
128 127
129 base::Closure update_policy_closure_; 128 base::Closure update_policy_closure_;
130 CancelableClosureHolder end_idle_period_closure_; 129 CancelableClosureHolder end_idle_period_closure_;
131 130
132 // Don't access current_policy_ directly, instead use SchedulerPolicy(). 131 // Don't access current_policy_ directly, instead use SchedulerPolicy().
133 Policy current_policy_; 132 Policy current_policy_;
134 133
135 base::TimeTicks estimated_next_frame_begin_; 134 base::TimeTicks estimated_next_frame_begin_;
136 135
137 // The incoming_signals_lock_ mutex protects access to last_input_time_ 136 // The incoming_signals_lock_ mutex protects access to last_input_time_
138 // and write access to policy_may_need_update_. 137 // and write access to policy_may_need_update_.
139 base::Lock incoming_signals_lock_; 138 base::Lock incoming_signals_lock_;
140 base::TimeTicks last_input_time_; 139 base::TimeTicks last_input_time_;
141 PollableNeedsUpdateFlag policy_may_need_update_; 140 PollableNeedsUpdateFlag policy_may_need_update_;
142 141
143 scoped_refptr<cc::TestNowSource> time_source_;
144
145 base::WeakPtr<RendererSchedulerImpl> weak_renderer_scheduler_ptr_; 142 base::WeakPtr<RendererSchedulerImpl> weak_renderer_scheduler_ptr_;
146 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; 143 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_;
147 144
148 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); 145 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl);
149 }; 146 };
150 147
151 } // namespace content 148 } // namespace content
152 149
153 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_ 150 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/scheduler/renderer_scheduler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698