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 { |
15 namespace trace_event { | 15 namespace trace_event { |
16 class TracedValue; | 16 class TracedValue; |
17 } | 17 } |
18 | 18 class SingleThreadTaskRunner; |
19 // TODO(ssid): remove these aliases after the tracing clients are moved to the | |
20 // new trace_event namespace. See crbug.com/451032. ETA: March 2015 | |
21 namespace debug { | |
22 using ::base::trace_event::TracedValue; | |
23 } | 19 } |
24 class SingleThreadTaskRunner; | |
25 } // namespace base | |
26 | 20 |
27 namespace cc { | 21 namespace cc { |
28 | 22 |
29 class CC_EXPORT TimeSourceClient { | 23 class CC_EXPORT TimeSourceClient { |
30 public: | 24 public: |
31 virtual void OnTimerTick() = 0; | 25 virtual void OnTimerTick() = 0; |
32 | 26 |
33 protected: | 27 protected: |
34 virtual ~TimeSourceClient() {} | 28 virtual ~TimeSourceClient() {} |
35 }; | 29 }; |
(...skipping 18 matching lines...) Expand all Loading... |
54 virtual bool Active() const; | 48 virtual bool Active() const; |
55 | 49 |
56 // Get the last and next tick times. NextTickTime() returns null when | 50 // Get the last and next tick times. NextTickTime() returns null when |
57 // inactive. | 51 // inactive. |
58 virtual base::TimeTicks LastTickTime() const; | 52 virtual base::TimeTicks LastTickTime() const; |
59 virtual base::TimeTicks NextTickTime() const; | 53 virtual base::TimeTicks NextTickTime() const; |
60 | 54 |
61 // Virtual for testing. | 55 // Virtual for testing. |
62 virtual base::TimeTicks Now() const; | 56 virtual base::TimeTicks Now() const; |
63 | 57 |
64 virtual void AsValueInto(base::debug::TracedValue* dict) const; | 58 virtual void AsValueInto(base::trace_event::TracedValue* dict) const; |
65 | 59 |
66 protected: | 60 protected: |
67 DelayBasedTimeSource(base::TimeDelta interval, | 61 DelayBasedTimeSource(base::TimeDelta interval, |
68 base::SingleThreadTaskRunner* task_runner); | 62 base::SingleThreadTaskRunner* task_runner); |
69 virtual ~DelayBasedTimeSource(); | 63 virtual ~DelayBasedTimeSource(); |
70 | 64 |
71 virtual std::string TypeString() const; | 65 virtual std::string TypeString() const; |
72 | 66 |
73 base::TimeTicks NextTickTarget(base::TimeTicks now); | 67 base::TimeTicks NextTickTarget(base::TimeTicks now); |
74 void PostNextTickTask(base::TimeTicks now); | 68 void PostNextTickTask(base::TimeTicks now); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 112 |
119 std::string TypeString() const override; | 113 std::string TypeString() const override; |
120 | 114 |
121 private: | 115 private: |
122 DISALLOW_COPY_AND_ASSIGN(DelayBasedTimeSourceHighRes); | 116 DISALLOW_COPY_AND_ASSIGN(DelayBasedTimeSourceHighRes); |
123 }; | 117 }; |
124 | 118 |
125 } // namespace cc | 119 } // namespace cc |
126 | 120 |
127 #endif // CC_SCHEDULER_DELAY_BASED_TIME_SOURCE_H_ | 121 #endif // CC_SCHEDULER_DELAY_BASED_TIME_SOURCE_H_ |
OLD | NEW |