Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Unified Diff: Source/core/animation/AnimationClock.h

Issue 251183006: Web Animations: Timeline should not advance during task execution (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use task start time Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/animation/AnimationClock.h
diff --git a/Source/core/animation/AnimationClock.h b/Source/core/animation/AnimationClock.h
index 540dfbeb2ebd126188b648a079d5a337dfb46ee1..d5ffead49de6619a07c00cdd2bf236635bdcb85d 100644
--- a/Source/core/animation/AnimationClock.h
+++ b/Source/core/animation/AnimationClock.h
@@ -31,40 +31,31 @@
#ifndef AnimationClock_h
#define AnimationClock_h
-#include "wtf/CurrentTime.h"
#include "wtf/PassOwnPtr.h"
namespace WebCore {
-// FIXME: This value is used to suppress updates when time is required outside of a frame.
-// The purpose of allowing the clock to update during such periods is to allow animations
-// to have an appropriate start time and for getComputedStyle to attempt to catch-up to a
-// compositor animation. However a more accurate system might be to attempt to phase-lock
-// with the frame clock.
-const double minTimeBeforeUnsynchronizedAnimationClockTick = 0.005;
-
class AnimationClock {
public:
- static PassOwnPtr<AnimationClock> create(WTF::TimeFunction monotonicallyIncreasingTime = WTF::monotonicallyIncreasingTime)
+ AnimationClock()
+ : m_time(0)
{
- return adoptPtr(new AnimationClock(monotonicallyIncreasingTime));
}
void updateTime(double time);
double currentTime();
- void unfreeze() { m_frozen = false; }
- void resetTimeForTesting() { m_time = 0; m_frozen = true; }
+ void resetTimeForTesting() { m_time = 0; taskTime() = 0; }
-private:
- AnimationClock(WTF::TimeFunction monotonicallyIncreasingTime)
- : m_monotonicallyIncreasingTime(monotonicallyIncreasingTime)
- , m_time(0)
- , m_frozen(false)
+ static double& taskTime()
shans 2014/04/30 20:43:07 I think this needs a comment indicating its purpos
esprehn 2014/04/30 22:43:50 Can we use a regular getter/setter pair instead of
dstockwell 2014/04/30 22:59:51 It's a static local, I can't access it from two di
esprehn 2014/04/30 23:54:33 Don't use a static local, make it a static member
{
+ static double time = 0;
+ return time;
}
- WTF::TimeFunction m_monotonicallyIncreasingTime;
+
+ static void notifyTaskStartTime(double time) { taskTime() = time; }
+
+private:
double m_time;
- bool m_frozen;
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698