Closed Bug 1473714 Opened 6 years ago Closed 6 years ago

FrameAnimator compares timestamps across processes

Categories

(Core :: Graphics: ImageLib, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox-esr52 --- wontfix
firefox-esr60 --- wontfix
firefox61 --- wontfix
firefox62 --- wontfix
firefox63 --- fixed

People

(Reporter: tjr, Assigned: tjr)

References

Details

(Keywords: assertion, Whiteboard: [gfx-noted])

Attachments

(1 file)

While working on Fuzzyfox, I started hitting this assertion: https://searchfox.org/mozilla-central/rev/403038737ba75af3842ba6b43b6e2fb47eb06609/image/FrameAnimator.cpp#241 > NS_ASSERTION(aTime <= TimeStamp::Now(), > "Given time appears to be in the future"); This happens because aTime comes from the parent process and this code (and thus TimeStamp::Now()) executes in the content process. aTime comes from nsRefreshDriver. Comparing timestamps across processes is problematic regardless of Fuzzyfox: there is no guarentee that such timestamps are consistent or in lockstep. Practically though it's unlikely to cause major issues unless one starts going to muck with time! And the default behavior of NS_ASSERTION is just to print a warning in debug mode (and nothing in release). Empirical testing (observing gifs while seeing the warnings print in the console) indicates this doesn't really cause problems. (At least with the 100/2000 us settings I have for Fuzzyfox right now.)
I don't think there is any reason we need that assertion. There are two other uses of Now in FrameAnimator: -GetCurrentImgFrameEndTime uses Now plus a day for "forever" frame timeouts of animated images, not realistically a problem -InitAnimationFrameTimeIfNecessary sets mCurrentAnimationFrameTime to Now which might actually cause confusion in the code that advances frames if the refresh driver time we get after this is actually before the saved time stamp, BUT we should never call into that code because FrameAnimator::RequestRefresh only advances frames if the current frame end time is in the past relative to the refresh driver time. All other uses appear to view time as relative to the passed in refresh driver time that I can see.
I agree, it should just be removed.
Keywords: assertion
Priority: -- → P3
Whiteboard: [gfx-noted]
Comment on attachment 8996827 [details] Bug 1473714 Remove unneeded commit in image/FrameAnimator.cpp:AdvanceFrame Timothy Nikkel (:tnikkel) has approved the revision. https://phabricator.services.mozilla.com/D2622
Attachment #8996827 - Flags: review+
Assignee: nobody → tom
Keywords: checkin-needed
Pushed by apavel@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/465005e948bf Remove unneeded commit in image/FrameAnimator.cpp:AdvanceFrame
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: