RESOLVED FIXED 136402
Simplify DOMTimer::adjustMinimumTimerInterval -> updateTimerIntervalIfNecessary
https://bugs.webkit.org/show_bug.cgi?id=136402
Summary Simplify DOMTimer::adjustMinimumTimerInterval -> updateTimerIntervalIfNecessary
Gavin Barraclough
Reported 2014-08-29 19:11:55 PDT
When the minimum DOM timer interval changes, the Page updates all DOMTimers accordingly. Updating the fire/repeat internal on TimerBase requires a delta, but in DOMTimer::adjustMinimumTimerInterval we have the new requested interval. In the case of repeating timers we can get the current interval to calculate the delta by calling repeatInterval(), but in the case of one-shot timers neither TimerBase no DOMTimer have store the interval that was actually set for the timer (DOMTimer knows the original, unadjusted timer, but not the actual interval). The way this currently works is that when the minimum interval changes, Page calls adjustMinimumTimerInterval providing the previous minimum. If the timer is one-shot, then adjustMinimumTimerInterval will use this to compute the delta based on what the interval would have been. We can simplify & unify with the code to throttle interval timers when the nesting threshold is hit, by instead tracking the current timer interval as a member on DOMTimer & using this to compute the delta in all cases.
Attachments
Fix (8.49 KB, patch)
2014-08-29 19:17 PDT, Gavin Barraclough
kling: review+
Gavin Barraclough
Comment 1 2014-08-29 19:17:22 PDT
Andreas Kling
Comment 2 2014-08-29 19:50:41 PDT
Comment on attachment 237403 [details] Fix View in context: https://bugs.webkit.org/attachment.cgi?id=237403&action=review r=me > Source/WebCore/ChangeLog:9 > + Updating the fire/repeat internal on TimerBase requires a delta, but in internal -> interval > Source/WebCore/ChangeLog:12 > + but in the case of one-shot timers neither TimerBase no DOMTimer have store the interval no -> nor
Gavin Barraclough
Comment 3 2014-09-03 10:05:53 PDT
Transmitting file data .... Committed revision 173208.
Note You need to log in before you can comment on or make changes to this bug.