Bug 154559 - Some timer alignment cleanup.
Summary: Some timer alignment cleanup.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Gavin Barraclough
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-22 14:57 PST by Gavin Barraclough
Modified: 2016-02-22 23:37 PST (History)
4 users (show)

See Also:


Attachments
Fix (7.16 KB, patch)
2016-02-22 16:16 PST, Gavin Barraclough
cdumez: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Barraclough 2016-02-22 14:57:51 PST
Document shouldn't override Page's timer alignment policy with a lower alignment, and m_domTimerAlignmentInterval isn't really a Settings, it's just the current state for the page.
Comment 1 Gavin Barraclough 2016-02-22 16:16:23 PST
Created attachment 271963 [details]
Fix
Comment 2 Anders Carlsson 2016-02-22 17:01:43 PST
Comment on attachment 271963 [details]
Fix

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

You should change this to use std::chrono::milliseconds!

> Source/WebCore/page/Page.h:620
> -    bool m_timerThrottlingEnabled;
> +    bool m_timerThrottlingEnabledTime;
> +    double m_timerAlignmentInterval;

Can this use Optional instead?
Comment 3 Gavin Barraclough 2016-02-22 17:45:13 PST
(In reply to comment #2)
> Comment on attachment 271963 [details]
> Fix
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=271963&action=review
> 
> You should change this to use std::chrono::milliseconds!

Heh, probably! - sure I'll look into this. (But as a separate change - these intervals are all currently doubles & I should probably switch double -> chrono::milliseconds in a bunch of other places at the same time).

> > Source/WebCore/page/Page.h:620
> > -    bool m_timerThrottlingEnabled;
> > +    bool m_timerThrottlingEnabledTime;
> > +    double m_timerAlignmentInterval;
> 
> Can this use Optional instead?

Interesting. I don't think this should be an Optional - when timer throttling is disabled the timer alignment property does still hold a value (DOMTimer::defaultAlignmentInterval() - which theoretically could be non-zero).

Also I plan on replacing m_timerThrottlingEnabled with the timestamp at which time throttling is enabled, so we know how long it has been - come to think of it, that probably should be an Optional.
Comment 4 Chris Dumez 2016-02-22 18:48:39 PST
Comment on attachment 271963 [details]
Fix

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

r=me % nits

> Source/WebCore/dom/Document.cpp:2934
> +    if (Page* page = this->page())

auto*

> Source/WebCore/page/Page.cpp:208
> +    , m_timerThrottlingEnabledTime(false)

I prefer the previous name since this is a boolean.
Comment 5 Gavin Barraclough 2016-02-22 23:28:54 PST
> > Source/WebCore/page/Page.cpp:208
> > +    , m_timerThrottlingEnabledTime(false)
> 
> I prefer the previous name since this is a boolean.

Oops, yes!
Comment 6 Gavin Barraclough 2016-02-22 23:37:35 PST
Transmitting file data ......
Committed revision 196971.