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