diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/core/animation/animation_clock.h')
-rw-r--r-- | chromium/third_party/blink/renderer/core/animation/animation_clock.h | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/chromium/third_party/blink/renderer/core/animation/animation_clock.h b/chromium/third_party/blink/renderer/core/animation/animation_clock.h index 56eb03f838b..b780210abdb 100644 --- a/chromium/third_party/blink/renderer/core/animation/animation_clock.h +++ b/chromium/third_party/blink/renderer/core/animation/animation_clock.h @@ -35,42 +35,25 @@ #include "base/macros.h" #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/platform/wtf/allocator.h" -#include "third_party/blink/renderer/platform/wtf/time.h" +#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" namespace blink { -// Maintains a stationary clock time during script execution. Tries to track -// the glass time (the moment photons leave the screen) of the current animation -// frame. +// Maintains a stationary clock time during script execution. Tracks the glass +// time of the beginning of the current animation frame (i.e. the moment photons +// left the screen for the previous frame). class CORE_EXPORT AnimationClock { DISALLOW_NEW(); public: - using TimeTicksFunction = base::TimeTicks (*)(); - explicit AnimationClock( - TimeTicksFunction monotonically_increasing_time = WTF::CurrentTimeTicks) - : monotonically_increasing_time_(monotonically_increasing_time), - time_(), - task_for_which_time_was_calculated_( - std::numeric_limits<unsigned>::max()) {} + AnimationClock() : time_() {} void UpdateTime(base::TimeTicks time); - double CurrentTime(); - void ResetTimeForTesting(base::TimeTicks time = base::TimeTicks()); - void DisableSyntheticTimeForTesting() { - monotonically_increasing_time_ = nullptr; - } - - // notifyTaskStart should be called right before the main message loop starts - // to run the next task from the message queue. - static void NotifyTaskStart() { ++currently_running_task_; } + base::TimeTicks CurrentTime() const; + void ResetTimeForTesting(); private: - TimeTicksFunction monotonically_increasing_time_; base::TimeTicks time_; - unsigned task_for_which_time_was_calculated_; - static unsigned currently_running_task_; DISALLOW_COPY_AND_ASSIGN(AnimationClock); }; |