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_DELAY_BASED_TIME_SOURCE_H_ | 5 #ifndef CC_DELAY_BASED_TIME_SOURCE_H_ |
6 #define CC_DELAY_BASED_TIME_SOURCE_H_ | 6 #define CC_DELAY_BASED_TIME_SOURCE_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "cc/cc_export.h" | 9 #include "cc/cc_export.h" |
10 #include "cc/time_source.h" | 10 #include "cc/time_source.h" |
11 | 11 |
12 namespace cc { | 12 namespace cc { |
13 | 13 |
| 14 class Thread; |
| 15 |
14 // This timer implements a time source that achieves the specified interval | 16 // This timer implements a time source that achieves the specified interval |
15 // in face of millisecond-precision delayed callbacks and random queueing delays
. | 17 // in face of millisecond-precision delayed callbacks and random queueing delays
. |
16 class CC_EXPORT DelayBasedTimeSource : public TimeSource { | 18 class CC_EXPORT DelayBasedTimeSource : public TimeSource { |
17 public: | 19 public: |
18 static scoped_refptr<DelayBasedTimeSource> create(base::TimeDelta interval,
Thread* thread); | 20 static scoped_refptr<DelayBasedTimeSource> create(base::TimeDelta interval,
Thread* thread); |
19 | 21 |
20 virtual void setClient(TimeSourceClient* client) OVERRIDE; | 22 virtual void setClient(TimeSourceClient* client) OVERRIDE; |
21 | 23 |
22 // TimeSource implementation | 24 // TimeSource implementation |
23 virtual void setTimebaseAndInterval(base::TimeTicks timebase, base::TimeDelt
a interval) OVERRIDE; | 25 virtual void setTimebaseAndInterval(base::TimeTicks timebase, base::TimeDelt
a interval) OVERRIDE; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 State m_state; | 72 State m_state; |
71 | 73 |
72 Thread* m_thread; | 74 Thread* m_thread; |
73 base::WeakPtrFactory<DelayBasedTimeSource> m_weakFactory; | 75 base::WeakPtrFactory<DelayBasedTimeSource> m_weakFactory; |
74 DISALLOW_COPY_AND_ASSIGN(DelayBasedTimeSource); | 76 DISALLOW_COPY_AND_ASSIGN(DelayBasedTimeSource); |
75 }; | 77 }; |
76 | 78 |
77 } // namespace cc | 79 } // namespace cc |
78 | 80 |
79 #endif // CC_DELAY_BASED_TIME_SOURCE_H_ | 81 #endif // CC_DELAY_BASED_TIME_SOURCE_H_ |
OLD | NEW |