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

Side by Side Diff: Source/core/animation/AnimationClock.h

Issue 551253002: Web Animations: Zero time of the document timeline should correspond with navigationStart (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Specify time when resetting animation clock in tests. Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 public: 43 public:
44 explicit AnimationClock(WTF::TimeFunction monotonicallyIncreasingTime = WTF: :monotonicallyIncreasingTime) 44 explicit AnimationClock(WTF::TimeFunction monotonicallyIncreasingTime = WTF: :monotonicallyIncreasingTime)
45 : m_monotonicallyIncreasingTime(monotonicallyIncreasingTime) 45 : m_monotonicallyIncreasingTime(monotonicallyIncreasingTime)
46 , m_time(0) 46 , m_time(0)
47 , m_currentTask(std::numeric_limits<unsigned>::max()) 47 , m_currentTask(std::numeric_limits<unsigned>::max())
48 { 48 {
49 } 49 }
50 50
51 void updateTime(double time); 51 void updateTime(double time);
52 double currentTime(); 52 double currentTime();
53 void resetTimeForTesting(); 53 void resetTimeForTesting(double time = 0);
54 54
55 static void notifyTaskStart() { ++s_currentTask; } 55 static void notifyTaskStart() { ++s_currentTask; }
56 56
57 private: 57 private:
58 WTF::TimeFunction m_monotonicallyIncreasingTime; 58 WTF::TimeFunction m_monotonicallyIncreasingTime;
59 double m_time; 59 double m_time;
60 unsigned m_currentTask; 60 unsigned m_currentTask;
61 static unsigned s_currentTask; 61 static unsigned s_currentTask;
62 }; 62 };
63 63
64 } // namespace blink 64 } // namespace blink
65 65
66 #endif // AnimationClock_h 66 #endif // AnimationClock_h
OLDNEW
« no previous file with comments | « LayoutTests/web-animations-api/timeline-time.html ('k') | Source/core/animation/AnimationClock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698