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

Side by Side Diff: cc/scheduler/scheduler.h

Issue 387493002: Fixing and enhancing OrderedSimpleTaskRunner to allow 100% deterministic tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing the gn build. Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 CC_SCHEDULER_SCHEDULER_H_ 5 #ifndef CC_SCHEDULER_SCHEDULER_H_
6 #define CC_SCHEDULER_SCHEDULER_H_ 6 #define CC_SCHEDULER_SCHEDULER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <string> 9 #include <string>
10 10
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 bool IsBeginMainFrameSent() const; 148 bool IsBeginMainFrameSent() const;
149 void SetContinuousPainting(bool continuous_painting) { 149 void SetContinuousPainting(bool continuous_painting) {
150 state_machine_.SetContinuousPainting(continuous_painting); 150 state_machine_.SetContinuousPainting(continuous_painting);
151 } 151 }
152 152
153 protected: 153 protected:
154 class CC_EXPORT SyntheticBeginFrameSource : public TimeSourceClient { 154 class CC_EXPORT SyntheticBeginFrameSource : public TimeSourceClient {
155 public: 155 public:
156 SyntheticBeginFrameSource(Scheduler* scheduler, 156 SyntheticBeginFrameSource(Scheduler* scheduler,
157 base::SingleThreadTaskRunner* task_runner); 157 scoped_refptr<DelayBasedTimeSource> time_source);
158 virtual ~SyntheticBeginFrameSource(); 158 virtual ~SyntheticBeginFrameSource();
159 159
160 // Updates the phase and frequency of the timer. 160 // Updates the phase and frequency of the timer.
161 void CommitVSyncParameters(base::TimeTicks timebase, 161 void CommitVSyncParameters(base::TimeTicks timebase,
162 base::TimeDelta interval); 162 base::TimeDelta interval);
163 163
164 // Activates future BeginFrames and, if activating, pushes the most 164 // Activates future BeginFrames and, if activating, pushes the most
165 // recently missed BeginFrame to the back of a retroactive queue. 165 // recently missed BeginFrame to the back of a retroactive queue.
166 void SetNeedsBeginFrame(bool needs_begin_frame, 166 void SetNeedsBeginFrame(bool needs_begin_frame,
167 std::deque<BeginFrameArgs>* begin_retro_frame_args); 167 std::deque<BeginFrameArgs>* begin_retro_frame_args);
(...skipping 11 matching lines...) Expand all
179 Scheduler* scheduler_; 179 Scheduler* scheduler_;
180 scoped_refptr<DelayBasedTimeSource> time_source_; 180 scoped_refptr<DelayBasedTimeSource> time_source_;
181 }; 181 };
182 182
183 Scheduler( 183 Scheduler(
184 SchedulerClient* client, 184 SchedulerClient* client,
185 const SchedulerSettings& scheduler_settings, 185 const SchedulerSettings& scheduler_settings,
186 int layer_tree_host_id, 186 int layer_tree_host_id,
187 const scoped_refptr<base::SingleThreadTaskRunner>& impl_task_runner); 187 const scoped_refptr<base::SingleThreadTaskRunner>& impl_task_runner);
188 188
189 virtual base::TimeTicks Now() const;
190
189 const SchedulerSettings settings_; 191 const SchedulerSettings settings_;
190 SchedulerClient* client_; 192 SchedulerClient* client_;
191 int layer_tree_host_id_; 193 int layer_tree_host_id_;
192 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_; 194 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_;
193 195
194 base::TimeDelta vsync_interval_; 196 base::TimeDelta vsync_interval_;
195 base::TimeDelta estimated_parent_draw_time_; 197 base::TimeDelta estimated_parent_draw_time_;
196 198
197 bool last_set_needs_begin_frame_; 199 bool last_set_needs_begin_frame_;
198 bool begin_unthrottled_frame_posted_; 200 bool begin_unthrottled_frame_posted_;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 void SetupSyntheticBeginFrames(); 236 void SetupSyntheticBeginFrames();
235 237
236 base::WeakPtrFactory<Scheduler> weak_factory_; 238 base::WeakPtrFactory<Scheduler> weak_factory_;
237 239
238 DISALLOW_COPY_AND_ASSIGN(Scheduler); 240 DISALLOW_COPY_AND_ASSIGN(Scheduler);
239 }; 241 };
240 242
241 } // namespace cc 243 } // namespace cc
242 244
243 #endif // CC_SCHEDULER_SCHEDULER_H_ 245 #endif // CC_SCHEDULER_SCHEDULER_H_
OLDNEW
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/scheduler/scheduler.cc » ('j') | cc/test/scheduler_test_common.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698