Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 27 matching lines...) Expand all Loading... | |
| 38 | 38 |
| 39 class AnimationClock { | 39 class AnimationClock { |
| 40 public: | 40 public: |
| 41 static PassOwnPtr<AnimationClock> create(WTF::TimeFunction monotonicallyIncr easingTime = WTF::monotonicallyIncreasingTime) | 41 static PassOwnPtr<AnimationClock> create(WTF::TimeFunction monotonicallyIncr easingTime = WTF::monotonicallyIncreasingTime) |
| 42 { | 42 { |
| 43 return adoptPtr(new AnimationClock(monotonicallyIncreasingTime)); | 43 return adoptPtr(new AnimationClock(monotonicallyIncreasingTime)); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void updateTime(double time) | 46 void updateTime(double time) |
| 47 { | 47 { |
| 48 ASSERT(m_time <= time); | |
|
Timothy Loh
2013/10/30 03:55:07
Could you mention why we're removing this asserti
Steve Block
2013/11/01 03:04:59
I removed it because we were hitting it in some un
| |
| 49 m_time = time; | 48 m_time = time; |
| 50 m_frozen = true; | 49 m_frozen = true; |
| 51 } | 50 } |
| 52 | 51 |
| 53 double currentTime() | 52 double currentTime() |
| 54 { | 53 { |
| 55 if (!m_frozen) | 54 if (!m_frozen) |
| 56 updateTime(m_monotonicallyIncreasingTime()); | 55 updateTime(m_monotonicallyIncreasingTime()); |
| 57 return m_time; | 56 return m_time; |
| 58 } | 57 } |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 69 { | 68 { |
| 70 } | 69 } |
| 71 WTF::TimeFunction m_monotonicallyIncreasingTime; | 70 WTF::TimeFunction m_monotonicallyIncreasingTime; |
| 72 double m_time; | 71 double m_time; |
| 73 bool m_frozen; | 72 bool m_frozen; |
| 74 }; | 73 }; |
| 75 | 74 |
| 76 } // namespace WebCore | 75 } // namespace WebCore |
| 77 | 76 |
| 78 #endif // AnimationClock_h | 77 #endif // AnimationClock_h |
| OLD | NEW |