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