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

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: Rebase onto master. Created 6 years, 3 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);
Sami 2014/08/29 13:13:51 Could this be a scoped_ptr instead? Looks like thi
mithro-old 2014/09/01 06:19:46 DelayBasedTimeSource is ref counted, so have to us
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 10 matching lines...) Expand all
178 178
179 Scheduler* scheduler_; 179 Scheduler* scheduler_;
180 scoped_refptr<DelayBasedTimeSource> time_source_; 180 scoped_refptr<DelayBasedTimeSource> time_source_;
181 }; 181 };
182 182
183 Scheduler(SchedulerClient* client, 183 Scheduler(SchedulerClient* client,
184 const SchedulerSettings& scheduler_settings, 184 const SchedulerSettings& scheduler_settings,
185 int layer_tree_host_id, 185 int layer_tree_host_id,
186 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); 186 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
187 187
188 virtual base::TimeTicks Now() const;
189
188 const SchedulerSettings settings_; 190 const SchedulerSettings settings_;
189 SchedulerClient* client_; 191 SchedulerClient* client_;
190 int layer_tree_host_id_; 192 int layer_tree_host_id_;
191 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 193 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
192 194
193 base::TimeDelta vsync_interval_; 195 base::TimeDelta vsync_interval_;
194 base::TimeDelta estimated_parent_draw_time_; 196 base::TimeDelta estimated_parent_draw_time_;
195 197
196 bool last_set_needs_begin_frame_; 198 bool last_set_needs_begin_frame_;
197 bool begin_unthrottled_frame_posted_; 199 bool begin_unthrottled_frame_posted_;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 void SetupSyntheticBeginFrames(); 235 void SetupSyntheticBeginFrames();
234 236
235 base::WeakPtrFactory<Scheduler> weak_factory_; 237 base::WeakPtrFactory<Scheduler> weak_factory_;
236 238
237 DISALLOW_COPY_AND_ASSIGN(Scheduler); 239 DISALLOW_COPY_AND_ASSIGN(Scheduler);
238 }; 240 };
239 241
240 } // namespace cc 242 } // namespace cc
241 243
242 #endif // CC_SCHEDULER_SCHEDULER_H_ 244 #endif // CC_SCHEDULER_SCHEDULER_H_
OLDNEW
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/scheduler/scheduler.cc » ('j') | cc/scheduler/scheduler_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698