| 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 24 matching lines...) Expand all Loading... |
| 35 : public base::RefCounted<DelayBasedTimeSource> { | 35 : public base::RefCounted<DelayBasedTimeSource> { |
| 36 public: | 36 public: |
| 37 static scoped_refptr<DelayBasedTimeSource> Create( | 37 static scoped_refptr<DelayBasedTimeSource> Create( |
| 38 base::TimeDelta interval, base::SingleThreadTaskRunner* task_runner); | 38 base::TimeDelta interval, base::SingleThreadTaskRunner* task_runner); |
| 39 | 39 |
| 40 virtual void SetClient(TimeSourceClient* client); | 40 virtual void SetClient(TimeSourceClient* client); |
| 41 | 41 |
| 42 // TimeSource implementation | 42 // TimeSource implementation |
| 43 virtual void SetTimebaseAndInterval(base::TimeTicks timebase, | 43 virtual void SetTimebaseAndInterval(base::TimeTicks timebase, |
| 44 base::TimeDelta interval); | 44 base::TimeDelta interval); |
| 45 base::TimeDelta Interval() const { return next_parameters_.interval; } |
| 45 | 46 |
| 46 virtual base::TimeTicks SetActive(bool active); | 47 virtual base::TimeTicks SetActive(bool active); |
| 47 virtual bool Active() const; | 48 virtual bool Active() const; |
| 48 | 49 |
| 49 // Get the last and next tick times. NextTickTime() returns null when | 50 // Get the last and next tick times. NextTickTime() returns null when |
| 50 // inactive. | 51 // inactive. |
| 51 virtual base::TimeTicks LastTickTime() const; | 52 virtual base::TimeTicks LastTickTime() const; |
| 52 virtual base::TimeTicks NextTickTime() const; | 53 virtual base::TimeTicks NextTickTime() const; |
| 53 | 54 |
| 54 // Virtual for testing. | 55 // Virtual for testing. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 110 |
| 110 virtual std::string TypeString() const OVERRIDE; | 111 virtual std::string TypeString() const OVERRIDE; |
| 111 | 112 |
| 112 private: | 113 private: |
| 113 DISALLOW_COPY_AND_ASSIGN(DelayBasedTimeSourceHighRes); | 114 DISALLOW_COPY_AND_ASSIGN(DelayBasedTimeSourceHighRes); |
| 114 }; | 115 }; |
| 115 | 116 |
| 116 } // namespace cc | 117 } // namespace cc |
| 117 | 118 |
| 118 #endif // CC_SCHEDULER_DELAY_BASED_TIME_SOURCE_H_ | 119 #endif // CC_SCHEDULER_DELAY_BASED_TIME_SOURCE_H_ |
| OLD | NEW |