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

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

Issue 1200113003: cc: Cleanup DelayBasedTimeSource code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@task_runner_refptr
Patch Set: mithro's review Created 5 years, 6 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
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 CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ 5 #ifndef CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_
6 #define CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ 6 #define CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 base::TimeDelta new_vsync_interval); 218 base::TimeDelta new_vsync_interval);
219 219
220 // Tracing 220 // Tracing
221 void AsValueInto(base::trace_event::TracedValue* dict) const override; 221 void AsValueInto(base::trace_event::TracedValue* dict) const override;
222 222
223 // TimeSourceClient 223 // TimeSourceClient
224 void OnTimerTick() override; 224 void OnTimerTick() override;
225 225
226 protected: 226 protected:
227 explicit SyntheticBeginFrameSource( 227 explicit SyntheticBeginFrameSource(
228 base::SingleThreadTaskRunner* task_runner,
228 scoped_ptr<DelayBasedTimeSource> time_source); 229 scoped_ptr<DelayBasedTimeSource> time_source);
229 230
230 BeginFrameArgs CreateBeginFrameArgs(base::TimeTicks frame_time, 231 BeginFrameArgs CreateBeginFrameArgs(base::TimeTicks frame_time,
231 BeginFrameArgs::BeginFrameArgsType type); 232 BeginFrameArgs::BeginFrameArgsType type);
232 233
233 // BeginFrameSourceBase 234 // BeginFrameSourceBase
234 void OnNeedsBeginFramesChange(bool needs_begin_frames) override; 235 void OnNeedsBeginFramesChange(bool needs_begin_frames) override;
235 236
237 base::SingleThreadTaskRunner* task_runner_;
236 scoped_ptr<DelayBasedTimeSource> time_source_; 238 scoped_ptr<DelayBasedTimeSource> time_source_;
237 239
238 private: 240 private:
241 base::WeakPtrFactory<SyntheticBeginFrameSource> weak_factory_;
242
239 DISALLOW_COPY_AND_ASSIGN(SyntheticBeginFrameSource); 243 DISALLOW_COPY_AND_ASSIGN(SyntheticBeginFrameSource);
240 }; 244 };
241 245
242 // A "virtual" frame source which lets you switch between multiple other frame 246 // A "virtual" frame source which lets you switch between multiple other frame
243 // sources while making sure the BeginFrameArgs stays increasing (possibly 247 // sources while making sure the BeginFrameArgs stays increasing (possibly
244 // enforcing minimum boundry between BeginFrameArgs messages). 248 // enforcing minimum boundry between BeginFrameArgs messages).
245 class CC_EXPORT BeginFrameSourceMultiplexer : public BeginFrameSourceBase, 249 class CC_EXPORT BeginFrameSourceMultiplexer : public BeginFrameSourceBase,
246 public BeginFrameObserver { 250 public BeginFrameObserver {
247 public: 251 public:
248 static scoped_ptr<BeginFrameSourceMultiplexer> Create(); 252 static scoped_ptr<BeginFrameSourceMultiplexer> Create();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 BeginFrameSource* active_source_; 287 BeginFrameSource* active_source_;
284 std::set<BeginFrameSource*> source_list_; 288 std::set<BeginFrameSource*> source_list_;
285 289
286 private: 290 private:
287 DISALLOW_COPY_AND_ASSIGN(BeginFrameSourceMultiplexer); 291 DISALLOW_COPY_AND_ASSIGN(BeginFrameSourceMultiplexer);
288 }; 292 };
289 293
290 } // namespace cc 294 } // namespace cc
291 295
292 #endif // CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ 296 #endif // CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_
OLDNEW
« no previous file with comments | « no previous file | cc/scheduler/begin_frame_source.cc » ('j') | cc/scheduler/delay_based_time_source.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698