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

Side by Side Diff: cc/test/scheduler_test_common.h

Issue 1781663004: Allow null begin frame sources in cc::Scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scheduler_change_begin_frame_source
Patch Set: Created 4 years, 9 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 | « cc/scheduler/scheduler_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_TEST_SCHEDULER_TEST_COMMON_H_ 5 #ifndef CC_TEST_SCHEDULER_TEST_COMMON_H_
6 #define CC_TEST_SCHEDULER_TEST_COMMON_H_ 6 #define CC_TEST_SCHEDULER_TEST_COMMON_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 bool NeedsBeginMainFrame() const { 231 bool NeedsBeginMainFrame() const {
232 return state_machine_.needs_begin_main_frame(); 232 return state_machine_.needs_begin_main_frame();
233 } 233 }
234 234
235 BeginFrameSource& frame_source() { return *begin_frame_source_; } 235 BeginFrameSource& frame_source() { return *begin_frame_source_; }
236 236
237 bool MainThreadMissedLastDeadline() const { 237 bool MainThreadMissedLastDeadline() const {
238 return state_machine_.main_thread_missed_last_deadline(); 238 return state_machine_.main_thread_missed_last_deadline();
239 } 239 }
240 240
241 bool begin_frames_expected() const { return observing_begin_frame_source_; } 241 bool begin_frames_expected() const {
242 return begin_frame_source_ && observing_begin_frame_source_;
243 }
242 244
243 ~TestScheduler() override; 245 ~TestScheduler() override;
244 246
245 base::TimeDelta BeginImplFrameInterval() { 247 base::TimeDelta BeginImplFrameInterval() {
246 return begin_impl_frame_tracker_.Interval(); 248 return begin_impl_frame_tracker_.Interval();
247 } 249 }
248 250
249 // Note: This setting will be overriden on the next BeginFrame in the 251 // Note: This setting will be overriden on the next BeginFrame in the
250 // scheduler. To control the value it gets on the next BeginFrame 252 // scheduler. To control the value it gets on the next BeginFrame
251 // Pass in a fake CompositorTimingHistory that indicates BeginMainFrame 253 // Pass in a fake CompositorTimingHistory that indicates BeginMainFrame
252 // to Activation is fast. 254 // to Activation is fast.
253 void SetCriticalBeginMainFrameToActivateIsFast(bool is_fast) { 255 void SetCriticalBeginMainFrameToActivateIsFast(bool is_fast) {
254 state_machine_.SetCriticalBeginMainFrameToActivateIsFast(is_fast); 256 state_machine_.SetCriticalBeginMainFrameToActivateIsFast(is_fast);
255 } 257 }
256 258
257 protected: 259 protected:
258 // Overridden from Scheduler. 260 // Overridden from Scheduler.
259 base::TimeTicks Now() const override; 261 base::TimeTicks Now() const override;
260 262
261 private: 263 private:
262 base::SimpleTestTickClock* now_src_; 264 base::SimpleTestTickClock* now_src_;
263 265
264 DISALLOW_COPY_AND_ASSIGN(TestScheduler); 266 DISALLOW_COPY_AND_ASSIGN(TestScheduler);
265 }; 267 };
266 268
267 } // namespace cc 269 } // namespace cc
268 270
269 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ 271 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698