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

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: Tick animation clock using approximate frame time. Created 6 years, 7 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..6902260c449d1fa1fbf7136adc5697bb61b8aba6 100644
--- a/Source/core/animation/AnimationClock.h
+++ b/Source/core/animation/AnimationClock.h
@@ -36,35 +36,26 @@
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 {
esprehn 2014/05/07 06:07:06 This should be non copyable since we return a refe
dstockwell 2014/05/07 06:51:38 Done.
public:
- static PassOwnPtr<AnimationClock> create(WTF::TimeFunction monotonicallyIncreasingTime = WTF::monotonicallyIncreasingTime)
+ AnimationClock(WTF::TimeFunction monotonicallyIncreasingTime = WTF::monotonicallyIncreasingTime)
esprehn 2014/05/07 06:07:06 missing explicit
dstockwell 2014/05/07 06:51:38 Done.
+ : m_monotonicallyIncreasingTime(monotonicallyIncreasingTime)
+ , m_time(0)
+ , m_currentTask(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();
+
+ static void notifyTaskStart() { ++s_currentTask; }
private:
- AnimationClock(WTF::TimeFunction monotonicallyIncreasingTime)
- : m_monotonicallyIncreasingTime(monotonicallyIncreasingTime)
- , m_time(0)
- , m_frozen(false)
- {
- }
WTF::TimeFunction m_monotonicallyIncreasingTime;
double m_time;
- bool m_frozen;
+ unsigned m_currentTask;
+ static unsigned s_currentTask;
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698