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

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

Issue 12623026: cc: Chromify TimeSource, DelayBasedTimeSource and test (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Back to doubles Created 7 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 | Annotate | Revision Log
« no previous file with comments | « cc/scheduler/scheduler_unittest.cc ('k') | cc/scheduler/vsync_time_source.h » ('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 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_TIME_SOURCE_H_ 5 #ifndef CC_SCHEDULER_TIME_SOURCE_H_
6 #define CC_SCHEDULER_TIME_SOURCE_H_ 6 #define CC_SCHEDULER_TIME_SOURCE_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "cc/base/cc_export.h" 10 #include "cc/base/cc_export.h"
11 11
12 namespace cc { 12 namespace cc {
13 13
14 class TimeSourceClient { 14 class TimeSourceClient {
15 public: 15 public:
16 virtual void onTimerTick() = 0; 16 virtual void OnTimerTick() = 0;
17 17
18 protected: 18 protected:
19 virtual ~TimeSourceClient() {} 19 virtual ~TimeSourceClient() {}
20 }; 20 };
21 21
22 // An generic interface for getting a reliably-ticking timesource of 22 // An generic interface for getting a reliably-ticking timesource of
23 // a specified rate. 23 // a specified rate.
24 // 24 //
25 // Be sure to call setActive(false) before releasing your reference to the 25 // Be sure to call SetActive(false) before releasing your reference to the
26 // timer, or it will keep on ticking! 26 // timer, or it will keep on ticking!
27 class CC_EXPORT TimeSource : public base::RefCounted<TimeSource> { 27 class CC_EXPORT TimeSource : public base::RefCounted<TimeSource> {
28 public: 28 public:
29 virtual void setClient(TimeSourceClient*) = 0; 29 virtual void SetClient(TimeSourceClient* client) = 0;
30 virtual void setActive(bool) = 0; 30 virtual void SetActive(bool active) = 0;
31 virtual bool active() const = 0; 31 virtual bool Active() const = 0;
32 virtual void setTimebaseAndInterval(base::TimeTicks timebase, 32 virtual void SetTimebaseAndInterval(base::TimeTicks timebase,
33 base::TimeDelta interval) = 0; 33 base::TimeDelta interval) = 0;
34 virtual base::TimeTicks lastTickTime() = 0; 34 virtual base::TimeTicks LastTickTime() = 0;
35 virtual base::TimeTicks nextTickTime() = 0; 35 virtual base::TimeTicks NextTickTime() = 0;
36 36
37 protected: 37 protected:
38 virtual ~TimeSource() {} 38 virtual ~TimeSource() {}
39 39
40 private: 40 private:
41 friend class base::RefCounted<TimeSource>; 41 friend class base::RefCounted<TimeSource>;
42 }; 42 };
43 43
44 } // namespace cc 44 } // namespace cc
45 45
46 #endif // CC_SCHEDULER_TIME_SOURCE_H_ 46 #endif // CC_SCHEDULER_TIME_SOURCE_H_
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler_unittest.cc ('k') | cc/scheduler/vsync_time_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698