Bug 155031

Summary: Unify determination of page timer alignment
Product: WebKit Reporter: Gavin Barraclough <barraclough>
Component: WebKit Misc.Assignee: Gavin Barraclough <barraclough>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Fix cdumez: review+

Description Gavin Barraclough 2016-03-04 12:16:09 PST
Currently this is scattered throughout Page - sites that call setDOMTimerAlignmentInterval have to determine the correct alignment interval.

Instead, replace setDOMTimerAlignmentInterval with updateDOMTimerAlignmentInterval, and unify the policy decision here.
Comment 1 Gavin Barraclough 2016-03-04 12:22:04 PST
Created attachment 273024 [details]
Fix
Comment 2 Chris Dumez 2016-03-04 12:44:12 PST
Comment on attachment 273024 [details]
Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=273024&action=review

r=me

> Source/WebCore/page/Page.cpp:1260
> +    else if (!m_timerAlignmentIntervalIncreaseTimer.isActive())

This is not new but is it possible for m_timerAlignmentInterval to change and for the timer to be active? If so, we currently fail to update the timer. I am guessing we may be working around this by disabling and then re-enabling throttling but if so, it is not very nice.
Comment 3 Gavin Barraclough 2016-03-04 12:56:31 PST
(In reply to comment #2)
> Comment on attachment 273024 [details]
>
> This is not new but is it possible for m_timerAlignmentInterval to change
> and for the timer to be active? If so, we currently fail to update the
> timer. I am guessing we may be working around this by disabling and then
> re-enabling throttling but if so, it is not very nice.

Per conversation with Chris, this is a deliberate part of the policy, as a simple solution to prevent timers from being pushed out infinitely.
Comment 4 Gavin Barraclough 2016-03-04 12:58:46 PST
Transmitting file data ...
Committed revision 197581.