Bug 1251405. Part 2. Use 64 bit ints to hold the delay between the current time and the last animation time. r=edwin

When storing ms, 32 bit ints can hold 2^32/1000/60/60/24 ~= 49 days. It's quite conceivable that someone would leave a tab in the background for 50 days.
This commit is contained in:
Timothy Nikkel 2016-03-04 21:54:03 -06:00
parent f0724d93e6
commit fde95fcc03

View File

@ -192,7 +192,7 @@ FrameAnimator::AdvanceFrame(TimeStamp aTime)
if (delay.ToMilliseconds() > loopTime) { if (delay.ToMilliseconds() > loopTime) {
// Explicitly use integer division to get the floor of the number of // Explicitly use integer division to get the floor of the number of
// loops. // loops.
uint32_t loops = static_cast<uint32_t>(delay.ToMilliseconds()) / loopTime; uint64_t loops = static_cast<uint64_t>(delay.ToMilliseconds()) / loopTime;
mCurrentAnimationFrameTime += mCurrentAnimationFrameTime +=
TimeDuration::FromMilliseconds(loops * loopTime); TimeDuration::FromMilliseconds(loops * loopTime);
} }