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" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 bool active_; | 88 bool active_; |
89 | 89 |
90 base::SingleThreadTaskRunner* task_runner_; | 90 base::SingleThreadTaskRunner* task_runner_; |
91 base::WeakPtrFactory<DelayBasedTimeSource> weak_factory_; | 91 base::WeakPtrFactory<DelayBasedTimeSource> weak_factory_; |
92 | 92 |
93 private: | 93 private: |
94 friend class base::RefCounted<DelayBasedTimeSource>; | 94 friend class base::RefCounted<DelayBasedTimeSource>; |
95 DISALLOW_COPY_AND_ASSIGN(DelayBasedTimeSource); | 95 DISALLOW_COPY_AND_ASSIGN(DelayBasedTimeSource); |
96 }; | 96 }; |
97 | 97 |
98 // DelayBasedTimeSource that once used base::TimeTicks::HighResNow as its time | |
99 // source, but is now a no-op. | |
100 // TODO(brianderson): Remove along with gfx::/FrameTime.http://crbug.com/447329 | |
101 class DelayBasedTimeSourceHighRes : public DelayBasedTimeSource { | |
102 public: | |
103 static scoped_refptr<DelayBasedTimeSourceHighRes> Create( | |
104 base::TimeDelta interval, base::SingleThreadTaskRunner* task_runner); | |
105 | |
106 base::TimeTicks Now() const override; | |
107 | |
108 protected: | |
109 DelayBasedTimeSourceHighRes(base::TimeDelta interval, | |
110 base::SingleThreadTaskRunner* task_runner); | |
111 ~DelayBasedTimeSourceHighRes() override; | |
112 | |
113 std::string TypeString() const override; | |
114 | |
115 private: | |
116 DISALLOW_COPY_AND_ASSIGN(DelayBasedTimeSourceHighRes); | |
117 }; | |
118 | |
119 } // namespace cc | 98 } // namespace cc |
120 | 99 |
121 #endif // CC_SCHEDULER_DELAY_BASED_TIME_SOURCE_H_ | 100 #endif // CC_SCHEDULER_DELAY_BASED_TIME_SOURCE_H_ |
OLD | NEW |