OLD | NEW |
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_DELAY_BASED_TIME_SOURCE_H_ | 5 #ifndef CC_SCHEDULER_DELAY_BASED_TIME_SOURCE_H_ |
6 #define CC_SCHEDULER_DELAY_BASED_TIME_SOURCE_H_ | 6 #define CC_SCHEDULER_DELAY_BASED_TIME_SOURCE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "cc/base/cc_export.h" | 12 #include "cc/base/cc_export.h" |
13 | 13 |
14 namespace base { class SingleThreadTaskRunner; } | 14 namespace base { |
| 15 namespace debug { |
| 16 class TracedValue; |
| 17 } |
| 18 class SingleThreadTaskRunner; |
| 19 } |
15 | 20 |
16 namespace cc { | 21 namespace cc { |
17 | 22 |
18 class CC_EXPORT TimeSourceClient { | 23 class CC_EXPORT TimeSourceClient { |
19 public: | 24 public: |
20 virtual void OnTimerTick() = 0; | 25 virtual void OnTimerTick() = 0; |
21 | 26 |
22 protected: | 27 protected: |
23 virtual ~TimeSourceClient() {} | 28 virtual ~TimeSourceClient() {} |
24 }; | 29 }; |
(...skipping 17 matching lines...) Expand all Loading... |
42 virtual bool Active() const; | 47 virtual bool Active() const; |
43 | 48 |
44 // Get the last and next tick times. NextTickTime() returns null when | 49 // Get the last and next tick times. NextTickTime() returns null when |
45 // inactive. | 50 // inactive. |
46 virtual base::TimeTicks LastTickTime() const; | 51 virtual base::TimeTicks LastTickTime() const; |
47 virtual base::TimeTicks NextTickTime() const; | 52 virtual base::TimeTicks NextTickTime() const; |
48 | 53 |
49 // Virtual for testing. | 54 // Virtual for testing. |
50 virtual base::TimeTicks Now() const; | 55 virtual base::TimeTicks Now() const; |
51 | 56 |
52 virtual scoped_ptr<base::Value> AsValue() const; | 57 virtual void AsValueInto(base::debug::TracedValue* dict) const; |
53 | 58 |
54 protected: | 59 protected: |
55 DelayBasedTimeSource(base::TimeDelta interval, | 60 DelayBasedTimeSource(base::TimeDelta interval, |
56 base::SingleThreadTaskRunner* task_runner); | 61 base::SingleThreadTaskRunner* task_runner); |
57 virtual ~DelayBasedTimeSource(); | 62 virtual ~DelayBasedTimeSource(); |
58 | 63 |
59 virtual std::string TypeString() const; | 64 virtual std::string TypeString() const; |
60 | 65 |
61 base::TimeTicks NextTickTarget(base::TimeTicks now); | 66 base::TimeTicks NextTickTarget(base::TimeTicks now); |
62 void PostNextTickTask(base::TimeTicks now); | 67 void PostNextTickTask(base::TimeTicks now); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 109 |
105 virtual std::string TypeString() const OVERRIDE; | 110 virtual std::string TypeString() const OVERRIDE; |
106 | 111 |
107 private: | 112 private: |
108 DISALLOW_COPY_AND_ASSIGN(DelayBasedTimeSourceHighRes); | 113 DISALLOW_COPY_AND_ASSIGN(DelayBasedTimeSourceHighRes); |
109 }; | 114 }; |
110 | 115 |
111 } // namespace cc | 116 } // namespace cc |
112 | 117 |
113 #endif // CC_SCHEDULER_DELAY_BASED_TIME_SOURCE_H_ | 118 #endif // CC_SCHEDULER_DELAY_BASED_TIME_SOURCE_H_ |
OLD | NEW |