<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[213519] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/213519">213519</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2017-03-07 09:11:06 -0800 (Tue, 07 Mar 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>Port DOMTimer from std::chrono::milliseconds to WTF::Seconds type
https://bugs.webkit.org/show_bug.cgi?id=169236
Reviewed by Simon Fraser.
Source/WebCore:
* dom/Document.cpp:
(WebCore::Document::minimumDOMTimerInterval):
(WebCore::Document::timerAlignmentInterval):
* dom/Document.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::adjustMinimumDOMTimerInterval):
(WebCore::ScriptExecutionContext::minimumDOMTimerInterval):
(WebCore::ScriptExecutionContext::timerAlignmentInterval):
* dom/ScriptExecutionContext.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didInstallTimerImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didInstallTimer):
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::didInstallTimer):
* inspector/InspectorTimelineAgent.h:
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createTimerInstallData):
* inspector/TimelineRecordFactory.h:
* page/DOMTimer.cpp:
(WebCore::shouldForwardUserGesture):
(WebCore::userGestureTokenToForward):
(WebCore::DOMTimer::DOMTimer):
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::intervalClampedToMinimum):
(WebCore::DOMTimer::alignedFireTime):
* page/DOMTimer.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::setTimeout):
(WebCore::DOMWindow::setInterval):
* page/Page.cpp:
(WebCore::Page::setTimerThrottlingState):
(WebCore::Page::setDOMTimerAlignmentIntervalIncreaseLimit):
(WebCore::Page::updateDOMTimerAlignmentInterval):
* page/Page.h:
(WebCore::Page::domTimerAlignmentInterval):
* page/Settings.cpp:
(WebCore::Settings::setMinimumDOMTimerInterval):
* page/Settings.h:
(WebCore::Settings::minimumDOMTimerInterval):
* page/SuspendableTimer.h:
(WebCore::SuspendableTimer::startRepeating):
(WebCore::SuspendableTimer::startOneShot):
(WebCore::SuspendableTimer::augmentFireInterval):
(WebCore::SuspendableTimer::augmentRepeatInterval):
* platform/Timer.cpp:
(WebCore::TimerBase::setNextFireTime):
* platform/Timer.h:
(WebCore::TimerBase::alignedFireTime):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setMinimumTimerInterval):
* testing/InternalSettings.h:
* testing/Internals.cpp:
(WebCore::Internals::isTimerThrottled):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::setTimeout):
(WebCore::WorkerGlobalScope::setInterval):
Source/WebKit2:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::updateHiddenPageThrottlingAutoIncreaseLimit):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::setHiddenPageDOMTimerThrottlingIncreaseLimit):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setHiddenPageDOMTimerThrottlingIncreaseLimit):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoredomScriptExecutionContextcpp">trunk/Source/WebCore/dom/ScriptExecutionContext.cpp</a></li>
<li><a href="#trunkSourceWebCoredomScriptExecutionContexth">trunk/Source/WebCore/dom/ScriptExecutionContext.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorInstrumentationcpp">trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorInstrumentationh">trunk/Source/WebCore/inspector/InspectorInstrumentation.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorTimelineAgentcpp">trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorTimelineAgenth">trunk/Source/WebCore/inspector/InspectorTimelineAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorTimelineRecordFactorycpp">trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorTimelineRecordFactoryh">trunk/Source/WebCore/inspector/TimelineRecordFactory.h</a></li>
<li><a href="#trunkSourceWebCorepageDOMTimercpp">trunk/Source/WebCore/page/DOMTimer.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMTimerh">trunk/Source/WebCore/page/DOMTimer.h</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowcpp">trunk/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageh">trunk/Source/WebCore/page/Page.h</a></li>
<li><a href="#trunkSourceWebCorepageSettingscpp">trunk/Source/WebCore/page/Settings.cpp</a></li>
<li><a href="#trunkSourceWebCorepageSettingsh">trunk/Source/WebCore/page/Settings.h</a></li>
<li><a href="#trunkSourceWebCorepageSuspendableTimerh">trunk/Source/WebCore/page/SuspendableTimer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformTimercpp">trunk/Source/WebCore/platform/Timer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformTimerh">trunk/Source/WebCore/platform/Timer.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingscpp">trunk/Source/WebCore/testing/InternalSettings.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingsh">trunk/Source/WebCore/testing/InternalSettings.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerGlobalScopecpp">trunk/Source/WebCore/workers/WorkerGlobalScope.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebViewcpp">trunk/Source/WebKit/win/WebView.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessPoolcpp">trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcessh">trunk/Source/WebKit2/WebProcess/WebProcess.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcessmessagesin">trunk/Source/WebKit2/WebProcess/WebProcess.messages.in</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/ChangeLog        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -1,5 +1,70 @@
</span><span class="cx"> 2017-03-07 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><ins>+ Port DOMTimer from std::chrono::milliseconds to WTF::Seconds type
+ https://bugs.webkit.org/show_bug.cgi?id=169236
+
+ Reviewed by Simon Fraser.
+
+ * dom/Document.cpp:
+ (WebCore::Document::minimumDOMTimerInterval):
+ (WebCore::Document::timerAlignmentInterval):
+ * dom/Document.h:
+ * dom/ScriptExecutionContext.cpp:
+ (WebCore::ScriptExecutionContext::adjustMinimumDOMTimerInterval):
+ (WebCore::ScriptExecutionContext::minimumDOMTimerInterval):
+ (WebCore::ScriptExecutionContext::timerAlignmentInterval):
+ * dom/ScriptExecutionContext.h:
+ * inspector/InspectorInstrumentation.cpp:
+ (WebCore::InspectorInstrumentation::didInstallTimerImpl):
+ * inspector/InspectorInstrumentation.h:
+ (WebCore::InspectorInstrumentation::didInstallTimer):
+ * inspector/InspectorTimelineAgent.cpp:
+ (WebCore::InspectorTimelineAgent::didInstallTimer):
+ * inspector/InspectorTimelineAgent.h:
+ * inspector/TimelineRecordFactory.cpp:
+ (WebCore::TimelineRecordFactory::createTimerInstallData):
+ * inspector/TimelineRecordFactory.h:
+ * page/DOMTimer.cpp:
+ (WebCore::shouldForwardUserGesture):
+ (WebCore::userGestureTokenToForward):
+ (WebCore::DOMTimer::DOMTimer):
+ (WebCore::DOMTimer::install):
+ (WebCore::DOMTimer::intervalClampedToMinimum):
+ (WebCore::DOMTimer::alignedFireTime):
+ * page/DOMTimer.h:
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::setTimeout):
+ (WebCore::DOMWindow::setInterval):
+ * page/Page.cpp:
+ (WebCore::Page::setTimerThrottlingState):
+ (WebCore::Page::setDOMTimerAlignmentIntervalIncreaseLimit):
+ (WebCore::Page::updateDOMTimerAlignmentInterval):
+ * page/Page.h:
+ (WebCore::Page::domTimerAlignmentInterval):
+ * page/Settings.cpp:
+ (WebCore::Settings::setMinimumDOMTimerInterval):
+ * page/Settings.h:
+ (WebCore::Settings::minimumDOMTimerInterval):
+ * page/SuspendableTimer.h:
+ (WebCore::SuspendableTimer::startRepeating):
+ (WebCore::SuspendableTimer::startOneShot):
+ (WebCore::SuspendableTimer::augmentFireInterval):
+ (WebCore::SuspendableTimer::augmentRepeatInterval):
+ * platform/Timer.cpp:
+ (WebCore::TimerBase::setNextFireTime):
+ * platform/Timer.h:
+ (WebCore::TimerBase::alignedFireTime):
+ * testing/InternalSettings.cpp:
+ (WebCore::InternalSettings::setMinimumTimerInterval):
+ * testing/InternalSettings.h:
+ * testing/Internals.cpp:
+ (WebCore::Internals::isTimerThrottled):
+ * workers/WorkerGlobalScope.cpp:
+ (WebCore::WorkerGlobalScope::setTimeout):
+ (WebCore::WorkerGlobalScope::setInterval):
+
+2017-03-07 Chris Dumez <cdumez@apple.com>
+
</ins><span class="cx"> Align initEvent / initCustomEvent / initMessageEvent with the latest specification
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=169176
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/dom/Document.cpp        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -2843,11 +2843,11 @@
</span><span class="cx"> write(WTFMove(textWithNewline), ownerDocument);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-std::chrono::milliseconds Document::minimumTimerInterval() const
</del><ins>+Seconds Document::minimumDOMTimerInterval() const
</ins><span class="cx"> {
</span><span class="cx"> auto* page = this->page();
</span><span class="cx"> if (!page)
</span><del>- return ScriptExecutionContext::minimumTimerInterval();
</del><ins>+ return ScriptExecutionContext::minimumDOMTimerInterval();
</ins><span class="cx"> return page->settings().minimumDOMTimerInterval();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2860,9 +2860,9 @@
</span><span class="cx"> didChangeTimerAlignmentInterval();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-std::chrono::milliseconds Document::timerAlignmentInterval(bool hasReachedMaxNestingLevel) const
</del><ins>+Seconds Document::domTimerAlignmentInterval(bool hasReachedMaxNestingLevel) const
</ins><span class="cx"> {
</span><del>- auto alignmentInterval = ScriptExecutionContext::timerAlignmentInterval(hasReachedMaxNestingLevel);
</del><ins>+ auto alignmentInterval = ScriptExecutionContext::domTimerAlignmentInterval(hasReachedMaxNestingLevel);
</ins><span class="cx"> if (!hasReachedMaxNestingLevel)
</span><span class="cx"> return alignmentInterval;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/dom/Document.h        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -1327,9 +1327,9 @@
</span><span class="cx">
</span><span class="cx"> void addMessage(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, RefPtr<Inspector::ScriptCallStack>&&, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0) final;
</span><span class="cx">
</span><del>- std::chrono::milliseconds minimumTimerInterval() const final;
</del><ins>+ Seconds minimumDOMTimerInterval() const final;
</ins><span class="cx">
</span><del>- std::chrono::milliseconds timerAlignmentInterval(bool hasReachedMaxNestingLevel) const final;
</del><ins>+ Seconds domTimerAlignmentInterval(bool hasReachedMaxNestingLevel) const final;
</ins><span class="cx">
</span><span class="cx"> void updateTitleFromTitleElement();
</span><span class="cx"> void updateTitle(const StringWithDirection&);
</span></span></pre></div>
<a id="trunkSourceWebCoredomScriptExecutionContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.cpp (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptExecutionContext.cpp        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.cpp        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -427,15 +427,15 @@
</span><span class="cx"> return *m_publicURLManager;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void ScriptExecutionContext::adjustMinimumTimerInterval(std::chrono::milliseconds oldMinimumTimerInterval)
</del><ins>+void ScriptExecutionContext::adjustMinimumDOMTimerInterval(Seconds oldMinimumTimerInterval)
</ins><span class="cx"> {
</span><del>- if (minimumTimerInterval() != oldMinimumTimerInterval) {
</del><ins>+ if (minimumDOMTimerInterval() != oldMinimumTimerInterval) {
</ins><span class="cx"> for (auto& timer : m_timeouts.values())
</span><span class="cx"> timer->updateTimerIntervalIfNecessary();
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-std::chrono::milliseconds ScriptExecutionContext::minimumTimerInterval() const
</del><ins>+Seconds ScriptExecutionContext::minimumDOMTimerInterval() const
</ins><span class="cx"> {
</span><span class="cx"> // The default implementation returns the DOMTimer's default
</span><span class="cx"> // minimum timer interval. FIXME: to make it work with dedicated
</span><span class="lines">@@ -451,7 +451,7 @@
</span><span class="cx"> timer->didChangeAlignmentInterval();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-std::chrono::milliseconds ScriptExecutionContext::timerAlignmentInterval(bool) const
</del><ins>+Seconds ScriptExecutionContext::domTimerAlignmentInterval(bool) const
</ins><span class="cx"> {
</span><span class="cx"> return DOMTimer::defaultAlignmentInterval();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomScriptExecutionContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.h (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptExecutionContext.h        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.h        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -189,12 +189,11 @@
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT JSC::VM& vm();
</span><span class="cx">
</span><del>- // Interval is in seconds.
- void adjustMinimumTimerInterval(std::chrono::milliseconds oldMinimumTimerInterval);
- virtual std::chrono::milliseconds minimumTimerInterval() const;
</del><ins>+ void adjustMinimumDOMTimerInterval(Seconds oldMinimumTimerInterval);
+ virtual Seconds minimumDOMTimerInterval() const;
</ins><span class="cx">
</span><span class="cx"> void didChangeTimerAlignmentInterval();
</span><del>- virtual std::chrono::milliseconds timerAlignmentInterval(bool hasReachedMaxNestingLevel) const;
</del><ins>+ virtual Seconds domTimerAlignmentInterval(bool hasReachedMaxNestingLevel) const;
</ins><span class="cx">
</span><span class="cx"> virtual EventQueue& eventQueue() const = 0;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorInstrumentationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -336,7 +336,7 @@
</span><span class="cx"> domDebuggerAgent->willSendXMLHttpRequest(url);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InspectorInstrumentation::didInstallTimerImpl(InstrumentingAgents& instrumentingAgents, int timerId, std::chrono::milliseconds timeout, bool singleShot, ScriptExecutionContext& context)
</del><ins>+void InspectorInstrumentation::didInstallTimerImpl(InstrumentingAgents& instrumentingAgents, int timerId, Seconds timeout, bool singleShot, ScriptExecutionContext& context)
</ins><span class="cx"> {
</span><span class="cx"> pauseOnNativeEventIfNeeded(instrumentingAgents, false, setTimerEventName, true);
</span><span class="cx"> didScheduleAsyncCall(instrumentingAgents, AsyncCallTypeTimer, timerId, context, singleShot);
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorInstrumentationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.h (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorInstrumentation.h        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.h        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -123,7 +123,7 @@
</span><span class="cx"> static bool forcePseudoState(const Element&, CSSSelector::PseudoClassType);
</span><span class="cx">
</span><span class="cx"> static void willSendXMLHttpRequest(ScriptExecutionContext*, const String& url);
</span><del>- static void didInstallTimer(ScriptExecutionContext&, int timerId, std::chrono::milliseconds timeout, bool singleShot);
</del><ins>+ static void didInstallTimer(ScriptExecutionContext&, int timerId, Seconds timeout, bool singleShot);
</ins><span class="cx"> static void didRemoveTimer(ScriptExecutionContext&, int timerId);
</span><span class="cx">
</span><span class="cx"> static InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext*, const String& scriptName, int scriptLine);
</span><span class="lines">@@ -293,7 +293,7 @@
</span><span class="cx"> static bool forcePseudoStateImpl(InstrumentingAgents&, const Element&, CSSSelector::PseudoClassType);
</span><span class="cx">
</span><span class="cx"> static void willSendXMLHttpRequestImpl(InstrumentingAgents&, const String& url);
</span><del>- static void didInstallTimerImpl(InstrumentingAgents&, int timerId, std::chrono::milliseconds timeout, bool singleShot, ScriptExecutionContext&);
</del><ins>+ static void didInstallTimerImpl(InstrumentingAgents&, int timerId, Seconds timeout, bool singleShot, ScriptExecutionContext&);
</ins><span class="cx"> static void didRemoveTimerImpl(InstrumentingAgents&, int timerId, ScriptExecutionContext&);
</span><span class="cx">
</span><span class="cx"> static InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents&, const String& scriptName, int scriptLine, ScriptExecutionContext*);
</span><span class="lines">@@ -642,7 +642,7 @@
</span><span class="cx"> willSendXMLHttpRequestImpl(*instrumentingAgents, url);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void InspectorInstrumentation::didInstallTimer(ScriptExecutionContext& context, int timerId, std::chrono::milliseconds timeout, bool singleShot)
</del><ins>+inline void InspectorInstrumentation::didInstallTimer(ScriptExecutionContext& context, int timerId, Seconds timeout, bool singleShot)
</ins><span class="cx"> {
</span><span class="cx"> FAST_RETURN_IF_NO_FRONTENDS(void());
</span><span class="cx"> if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorTimelineAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -384,7 +384,7 @@
</span><span class="cx"> didCompleteCurrentRecord(TimelineRecordType::Paint);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InspectorTimelineAgent::didInstallTimer(int timerId, std::chrono::milliseconds timeout, bool singleShot, Frame* frame)
</del><ins>+void InspectorTimelineAgent::didInstallTimer(int timerId, Seconds timeout, bool singleShot, Frame* frame)
</ins><span class="cx"> {
</span><span class="cx"> appendRecord(TimelineRecordFactory::createTimerInstallData(timerId, timeout, singleShot), TimelineRecordType::TimerInstall, true, frame);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorTimelineAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.h (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.h        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.h        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -112,7 +112,7 @@
</span><span class="cx"> void stopFromConsole(JSC::ExecState*, const String& title);
</span><span class="cx">
</span><span class="cx"> // InspectorInstrumentation
</span><del>- void didInstallTimer(int timerId, std::chrono::milliseconds timeout, bool singleShot, Frame*);
</del><ins>+ void didInstallTimer(int timerId, Seconds timeout, bool singleShot, Frame*);
</ins><span class="cx"> void didRemoveTimer(int timerId, Frame*);
</span><span class="cx"> void willFireTimer(int timerId, Frame*);
</span><span class="cx"> void didFireTimer();
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorTimelineRecordFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -94,11 +94,11 @@
</span><span class="cx"> return data;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Ref<InspectorObject> TimelineRecordFactory::createTimerInstallData(int timerId, std::chrono::milliseconds timeout, bool singleShot)
</del><ins>+Ref<InspectorObject> TimelineRecordFactory::createTimerInstallData(int timerId, Seconds timeout, bool singleShot)
</ins><span class="cx"> {
</span><span class="cx"> Ref<InspectorObject> data = InspectorObject::create();
</span><span class="cx"> data->setInteger(ASCIILiteral("timerId"), timerId);
</span><del>- data->setInteger(ASCIILiteral("timeout"), (int)timeout.count());
</del><ins>+ data->setInteger(ASCIILiteral("timeout"), (int)timeout.milliseconds());
</ins><span class="cx"> data->setBoolean(ASCIILiteral("singleShot"), singleShot);
</span><span class="cx"> return data;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorTimelineRecordFactoryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/TimelineRecordFactory.h (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/TimelineRecordFactory.h        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/inspector/TimelineRecordFactory.h        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> static Ref<Inspector::InspectorObject> createProbeSampleData(const Inspector::ScriptBreakpointAction&, unsigned sampleId);
</span><span class="cx"> static Ref<Inspector::InspectorObject> createEventDispatchData(const Event&);
</span><span class="cx"> static Ref<Inspector::InspectorObject> createGenericTimerData(int timerId);
</span><del>- static Ref<Inspector::InspectorObject> createTimerInstallData(int timerId, std::chrono::milliseconds timeout, bool singleShot);
</del><ins>+ static Ref<Inspector::InspectorObject> createTimerInstallData(int timerId, Seconds timeout, bool singleShot);
</ins><span class="cx"> static Ref<Inspector::InspectorObject> createEvaluateScriptData(const String&, double lineNumber);
</span><span class="cx"> static Ref<Inspector::InspectorObject> createTimeStampData(const String&);
</span><span class="cx"> static Ref<Inspector::InspectorObject> createAnimationFrameData(int callbackId);
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMTimercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMTimer.cpp (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMTimer.cpp        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/page/DOMTimer.cpp        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -52,8 +52,8 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-static const auto maxIntervalForUserGestureForwarding = 1000ms; // One second matches Gecko.
-static const auto minIntervalForNonUserObservableChangeTimers = 1000ms; // Empirically determined to maximize battery life.
</del><ins>+static const Seconds maxIntervalForUserGestureForwarding { 1_s }; // One second matches Gecko.
+static const Seconds minIntervalForNonUserObservableChangeTimers { 1_s }; // Empirically determined to maximize battery life.
</ins><span class="cx"> static const int maxTimerNestingLevel = 5;
</span><span class="cx">
</span><span class="cx"> class DOMTimerFireState {
</span><span class="lines">@@ -161,7 +161,7 @@
</span><span class="cx">
</span><span class="cx"> bool NestedTimersMap::isTrackingNestedTimers = false;
</span><span class="cx">
</span><del>-static inline bool shouldForwardUserGesture(std::chrono::milliseconds interval, int nestingLevel)
</del><ins>+static inline bool shouldForwardUserGesture(Seconds interval, int nestingLevel)
</ins><span class="cx"> {
</span><span class="cx"> return UserGestureIndicator::processingUserGesture()
</span><span class="cx"> && interval <= maxIntervalForUserGestureForwarding
</span><span class="lines">@@ -168,7 +168,7 @@
</span><span class="cx"> && !nestingLevel; // Gestures should not be forwarded to nested timers.
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static inline RefPtr<UserGestureToken> userGestureTokenToForward(std::chrono::milliseconds interval, int nestingLevel)
</del><ins>+static inline RefPtr<UserGestureToken> userGestureTokenToForward(Seconds interval, int nestingLevel)
</ins><span class="cx"> {
</span><span class="cx"> if (!shouldForwardUserGesture(interval, nestingLevel))
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx"> return UserGestureIndicator::currentUserGesture();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-DOMTimer::DOMTimer(ScriptExecutionContext& context, std::unique_ptr<ScheduledAction> action, std::chrono::milliseconds interval, bool singleShot)
</del><ins>+DOMTimer::DOMTimer(ScriptExecutionContext& context, std::unique_ptr<ScheduledAction> action, Seconds interval, bool singleShot)
</ins><span class="cx"> : SuspendableTimer(context)
</span><span class="cx"> , m_nestingLevel(context.timerNestingLevel())
</span><span class="cx"> , m_action(WTFMove(action))
</span><span class="lines">@@ -202,7 +202,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-int DOMTimer::install(ScriptExecutionContext& context, std::unique_ptr<ScheduledAction> action, std::chrono::milliseconds timeout, bool singleShot)
</del><ins>+int DOMTimer::install(ScriptExecutionContext& context, std::unique_ptr<ScheduledAction> action, Seconds timeout, bool singleShot)
</ins><span class="cx"> {
</span><span class="cx"> // DOMTimer constructor passes ownership of the initial ref on the object to the constructor.
</span><span class="cx"> // This reference will be released automatically when a one-shot timer fires, when the context
</span><span class="lines">@@ -211,7 +211,7 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> if (is<Document>(context)) {
</span><span class="cx"> bool didDeferTimeout = context.activeDOMObjectsAreSuspended();
</span><del>- if (!didDeferTimeout && timeout.count() <= 100 && singleShot) {
</del><ins>+ if (!didDeferTimeout && timeout <= 100_ms && singleShot) {
</ins><span class="cx"> WKSetObservedContentChange(WKContentIndeterminateChange);
</span><span class="cx"> WebThreadAddObservedContentModifier(timer); // Will only take affect if not already visibility change.
</span><span class="cx"> }
</span><span class="lines">@@ -400,21 +400,21 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (repeatInterval()) {
</span><del>- ASSERT(repeatIntervalMS() == previousInterval);
- LOG(DOMTimers, "%p - Updating DOMTimer's repeat interval from %" PRId64 " ms to %" PRId64 " ms due to throttling.", this, previousInterval.count(), m_currentTimerInterval.count());
</del><ins>+ ASSERT(repeatIntervalSeconds() == previousInterval);
+ LOG(DOMTimers, "%p - Updating DOMTimer's repeat interval from %.2f ms to %.2f ms due to throttling.", this, previousInterval.milliseconds(), m_currentTimerInterval.milliseconds());
</ins><span class="cx"> augmentRepeatInterval(m_currentTimerInterval - previousInterval);
</span><span class="cx"> } else {
</span><del>- LOG(DOMTimers, "%p - Updating DOMTimer's fire interval from %" PRId64 " ms to %" PRId64 " ms due to throttling.", this, previousInterval.count(), m_currentTimerInterval.count());
</del><ins>+ LOG(DOMTimers, "%p - Updating DOMTimer's fire interval from %.2f ms to %.2f ms due to throttling.", this, previousInterval.milliseconds(), m_currentTimerInterval.milliseconds());
</ins><span class="cx"> augmentFireInterval(m_currentTimerInterval - previousInterval);
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-std::chrono::milliseconds DOMTimer::intervalClampedToMinimum() const
</del><ins>+Seconds DOMTimer::intervalClampedToMinimum() const
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(scriptExecutionContext());
</span><span class="cx"> ASSERT(m_nestingLevel <= maxTimerNestingLevel);
</span><span class="cx">
</span><del>- auto interval = std::max(1ms, m_originalInterval);
</del><ins>+ Seconds interval = std::max(1_ms, m_originalInterval);
</ins><span class="cx">
</span><span class="cx"> // Only apply throttling to repeating timers.
</span><span class="cx"> if (m_nestingLevel < maxTimerNestingLevel)
</span><span class="lines">@@ -421,24 +421,24 @@
</span><span class="cx"> return interval;
</span><span class="cx">
</span><span class="cx"> // Apply two throttles - the global (per Page) minimum, and also a per-timer throttle.
</span><del>- interval = std::max(interval, scriptExecutionContext()->minimumTimerInterval());
</del><ins>+ interval = std::max(interval, scriptExecutionContext()->minimumDOMTimerInterval());
</ins><span class="cx"> if (m_throttleState == ShouldThrottle)
</span><span class="cx"> interval = std::max(interval, minIntervalForNonUserObservableChangeTimers);
</span><span class="cx"> return interval;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-std::optional<std::chrono::milliseconds> DOMTimer::alignedFireTime(std::chrono::milliseconds fireTime) const
</del><ins>+std::optional<Seconds> DOMTimer::alignedFireTime(Seconds fireTime) const
</ins><span class="cx"> {
</span><del>- auto alignmentInterval = scriptExecutionContext()->timerAlignmentInterval(m_nestingLevel >= maxTimerNestingLevel);
- if (alignmentInterval == 0ms)
</del><ins>+ Seconds alignmentInterval = scriptExecutionContext()->domTimerAlignmentInterval(m_nestingLevel >= maxTimerNestingLevel);
+ if (!alignmentInterval)
</ins><span class="cx"> return std::nullopt;
</span><span class="cx">
</span><span class="cx"> static const double randomizedProportion = randomNumber();
</span><span class="cx">
</span><span class="cx"> // Force alignment to randomizedAlignment fraction of the way between alignemntIntervals, e.g.
</span><del>- // if alignmentInterval is 10 and randomizedAlignment is 0.3 this will align to 3, 13, 23, ...
- auto randomizedOffset = std::chrono::duration_cast<std::chrono::milliseconds>(alignmentInterval * randomizedProportion);
- auto adjustedFireTime = fireTime - randomizedOffset;
</del><ins>+ // if alignmentInterval is 10_ms and randomizedAlignment is 0.3 this will align to 3, 13, 23, ...
+ Seconds randomizedOffset = alignmentInterval * randomizedProportion;
+ Seconds adjustedFireTime = fireTime - randomizedOffset;
</ins><span class="cx"> return adjustedFireTime - (adjustedFireTime % alignmentInterval) + alignmentInterval + randomizedOffset;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMTimerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMTimer.h (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMTimer.h        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/page/DOMTimer.h        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include "UserGestureIndicator.h"
</span><span class="cx"> #include <memory>
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><ins>+#include <wtf/Seconds.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -44,13 +45,13 @@
</span><span class="cx"> public:
</span><span class="cx"> virtual ~DOMTimer();
</span><span class="cx">
</span><del>- static std::chrono::milliseconds defaultMinimumInterval() { return 4ms; }
- static std::chrono::milliseconds defaultAlignmentInterval() { return 0ms; }
- static std::chrono::milliseconds hiddenPageAlignmentInterval() { return 1000ms; }
</del><ins>+ static Seconds defaultMinimumInterval() { return 4_ms; }
+ static Seconds defaultAlignmentInterval() { return 0_s; }
+ static Seconds hiddenPageAlignmentInterval() { return 1_s; }
</ins><span class="cx">
</span><span class="cx"> // Creates a new timer owned by specified ScriptExecutionContext, starts it
</span><span class="cx"> // and returns its Id.
</span><del>- static int install(ScriptExecutionContext&, std::unique_ptr<ScheduledAction>, std::chrono::milliseconds timeout, bool singleShot);
</del><ins>+ static int install(ScriptExecutionContext&, std::unique_ptr<ScheduledAction>, Seconds timeout, bool singleShot);
</ins><span class="cx"> static void removeById(ScriptExecutionContext&, int timeoutId);
</span><span class="cx">
</span><span class="cx"> // Notify that the interval may need updating (e.g. because the minimum interval
</span><span class="lines">@@ -60,10 +61,10 @@
</span><span class="cx"> static void scriptDidInteractWithPlugin(HTMLPlugInElement&);
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- DOMTimer(ScriptExecutionContext&, std::unique_ptr<ScheduledAction>, std::chrono::milliseconds interval, bool singleShot);
</del><ins>+ DOMTimer(ScriptExecutionContext&, std::unique_ptr<ScheduledAction>, Seconds interval, bool singleShot);
</ins><span class="cx"> friend class Internals;
</span><span class="cx">
</span><del>- WEBCORE_EXPORT std::chrono::milliseconds intervalClampedToMinimum() const;
</del><ins>+ WEBCORE_EXPORT Seconds intervalClampedToMinimum() const;
</ins><span class="cx">
</span><span class="cx"> bool isDOMTimersThrottlingEnabled(Document&) const;
</span><span class="cx"> void updateThrottlingStateIfNecessary(const DOMTimerFireState&);
</span><span class="lines">@@ -71,7 +72,7 @@
</span><span class="cx"> // SuspendableTimer
</span><span class="cx"> void fired() override;
</span><span class="cx"> void didStop() override;
</span><del>- WEBCORE_EXPORT std::optional<std::chrono::milliseconds> alignedFireTime(std::chrono::milliseconds) const override;
</del><ins>+ WEBCORE_EXPORT std::optional<Seconds> alignedFireTime(Seconds) const override;
</ins><span class="cx">
</span><span class="cx"> // ActiveDOMObject API.
</span><span class="cx"> const char* activeDOMObjectName() const override;
</span><span class="lines">@@ -85,9 +86,9 @@
</span><span class="cx"> int m_timeoutId;
</span><span class="cx"> int m_nestingLevel;
</span><span class="cx"> std::unique_ptr<ScheduledAction> m_action;
</span><del>- std::chrono::milliseconds m_originalInterval;
</del><ins>+ Seconds m_originalInterval;
</ins><span class="cx"> TimerThrottleState m_throttleState;
</span><del>- std::chrono::milliseconds m_currentTimerInterval;
</del><ins>+ Seconds m_currentTimerInterval;
</ins><span class="cx"> RefPtr<UserGestureToken> m_userGestureTokenToForward;
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.cpp (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.cpp        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/page/DOMWindow.cpp        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -1663,7 +1663,7 @@
</span><span class="cx"> auto* context = scriptExecutionContext();
</span><span class="cx"> if (!context)
</span><span class="cx"> return Exception { INVALID_ACCESS_ERR };
</span><del>- return DOMTimer::install(*context, WTFMove(action), std::chrono::milliseconds(timeout), true);
</del><ins>+ return DOMTimer::install(*context, WTFMove(action), Seconds::fromMilliseconds(timeout), true);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void DOMWindow::clearTimeout(int timeoutId)
</span><span class="lines">@@ -1695,7 +1695,7 @@
</span><span class="cx"> auto* context = scriptExecutionContext();
</span><span class="cx"> if (!context)
</span><span class="cx"> return Exception { INVALID_ACCESS_ERR };
</span><del>- return DOMTimer::install(*context, WTFMove(action), std::chrono::milliseconds(timeout), false);
</del><ins>+ return DOMTimer::install(*context, WTFMove(action), Seconds::fromMilliseconds(timeout), false);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void DOMWindow::clearInterval(int timeoutId)
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/page/Page.cpp        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -234,8 +234,8 @@
</span><span class="cx"> #if ENABLE(VIEW_MODE_CSS_MEDIA)
</span><span class="cx"> , m_viewMode(ViewModeWindowed)
</span><span class="cx"> #endif // ENABLE(VIEW_MODE_CSS_MEDIA)
</span><del>- , m_timerAlignmentInterval(DOMTimer::defaultAlignmentInterval())
- , m_timerAlignmentIntervalIncreaseTimer(*this, &Page::timerAlignmentIntervalIncreaseTimerFired)
</del><ins>+ , m_domTimerAlignmentInterval(DOMTimer::defaultAlignmentInterval())
+ , m_domTimerAlignmentIntervalIncreaseTimer(*this, &Page::domTimerAlignmentIntervalIncreaseTimerFired)
</ins><span class="cx"> , m_isEditable(false)
</span><span class="cx"> , m_isPrerender(false)
</span><span class="cx"> , m_activityState(PageInitialActivityState)
</span><span class="lines">@@ -1320,7 +1320,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> m_timerThrottlingState = state;
</span><del>- m_timerThrottlingStateLastChangedTime = std::chrono::steady_clock::now();
</del><ins>+ m_timerThrottlingStateLastChangedTime = MonotonicTime::now();
</ins><span class="cx">
</span><span class="cx"> updateDOMTimerAlignmentInterval();
</span><span class="cx">
</span><span class="lines">@@ -1333,12 +1333,12 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void Page::setTimerAlignmentIntervalIncreaseLimit(std::chrono::milliseconds limit)
</del><ins>+void Page::setDOMTimerAlignmentIntervalIncreaseLimit(Seconds limit)
</ins><span class="cx"> {
</span><del>- m_timerAlignmentIntervalIncreaseLimit = limit;
</del><ins>+ m_domTimerAlignmentIntervalIncreaseLimit = limit;
</ins><span class="cx">
</span><del>- // If (m_timerAlignmentIntervalIncreaseLimit < m_timerAlignmentInterval) then we need
- // to update m_timerAlignmentInterval, if greater then need to restart the increase timer.
</del><ins>+ // If (m_domTimerAlignmentIntervalIncreaseLimit < m_domTimerAlignmentInterval) then we need
+ // to update m_domTimerAlignmentInterval, if greater then need to restart the increase timer.
</ins><span class="cx"> if (m_timerThrottlingState == TimerThrottlingState::EnabledIncreasing)
</span><span class="cx"> updateDOMTimerAlignmentInterval();
</span><span class="cx"> }
</span><span class="lines">@@ -1349,28 +1349,28 @@
</span><span class="cx">
</span><span class="cx"> switch (m_timerThrottlingState) {
</span><span class="cx"> case TimerThrottlingState::Disabled:
</span><del>- m_timerAlignmentInterval = DOMTimer::defaultAlignmentInterval();
</del><ins>+ m_domTimerAlignmentInterval = DOMTimer::defaultAlignmentInterval();
</ins><span class="cx"> break;
</span><span class="cx">
</span><span class="cx"> case TimerThrottlingState::Enabled:
</span><del>- m_timerAlignmentInterval = DOMTimer::hiddenPageAlignmentInterval();
</del><ins>+ m_domTimerAlignmentInterval = DOMTimer::hiddenPageAlignmentInterval();
</ins><span class="cx"> break;
</span><span class="cx">
</span><span class="cx"> case TimerThrottlingState::EnabledIncreasing:
</span><span class="cx"> // For pages in prerender state maximum throttling kicks in immediately.
</span><span class="cx"> if (m_isPrerender)
</span><del>- m_timerAlignmentInterval = m_timerAlignmentIntervalIncreaseLimit;
</del><ins>+ m_domTimerAlignmentInterval = m_domTimerAlignmentIntervalIncreaseLimit;
</ins><span class="cx"> else {
</span><del>- ASSERT(m_timerThrottlingStateLastChangedTime.time_since_epoch() != std::chrono::steady_clock::duration::zero());
- m_timerAlignmentInterval = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - m_timerThrottlingStateLastChangedTime);
</del><ins>+ ASSERT(!!m_timerThrottlingStateLastChangedTime);
+ m_domTimerAlignmentInterval = MonotonicTime::now() - m_timerThrottlingStateLastChangedTime;
</ins><span class="cx"> // If we're below the limit, set the timer. If above, clamp to limit.
</span><del>- if (m_timerAlignmentInterval < m_timerAlignmentIntervalIncreaseLimit)
</del><ins>+ if (m_domTimerAlignmentInterval < m_domTimerAlignmentIntervalIncreaseLimit)
</ins><span class="cx"> needsIncreaseTimer = true;
</span><span class="cx"> else
</span><del>- m_timerAlignmentInterval = m_timerAlignmentIntervalIncreaseLimit;
</del><ins>+ m_domTimerAlignmentInterval = m_domTimerAlignmentIntervalIncreaseLimit;
</ins><span class="cx"> }
</span><span class="cx"> // Alignment interval should not be less than DOMTimer::hiddenPageAlignmentInterval().
</span><del>- m_timerAlignmentInterval = std::max(m_timerAlignmentInterval, DOMTimer::hiddenPageAlignmentInterval());
</del><ins>+ m_domTimerAlignmentInterval = std::max(m_domTimerAlignmentInterval, DOMTimer::hiddenPageAlignmentInterval());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // If throttling is enabled, auto-increasing of throttling is enabled, and the auto-increase
</span><span class="lines">@@ -1378,16 +1378,16 @@
</span><span class="cx"> // between increases is equal to the current throttle time. Since alinment interval increases
</span><span class="cx"> // exponentially, time between steps is exponential too.
</span><span class="cx"> if (!needsIncreaseTimer)
</span><del>- m_timerAlignmentIntervalIncreaseTimer.stop();
- else if (!m_timerAlignmentIntervalIncreaseTimer.isActive())
- m_timerAlignmentIntervalIncreaseTimer.startOneShot(m_timerAlignmentInterval);
</del><ins>+ m_domTimerAlignmentIntervalIncreaseTimer.stop();
+ else if (!m_domTimerAlignmentIntervalIncreaseTimer.isActive())
+ m_domTimerAlignmentIntervalIncreaseTimer.startOneShot(m_domTimerAlignmentInterval);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void Page::timerAlignmentIntervalIncreaseTimerFired()
</del><ins>+void Page::domTimerAlignmentIntervalIncreaseTimerFired()
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_settings->hiddenPageDOMTimerThrottlingAutoIncreases());
</span><span class="cx"> ASSERT(m_timerThrottlingState == TimerThrottlingState::EnabledIncreasing);
</span><del>- ASSERT(m_timerAlignmentInterval < m_timerAlignmentIntervalIncreaseLimit);
</del><ins>+ ASSERT(m_domTimerAlignmentInterval < m_domTimerAlignmentIntervalIncreaseLimit);
</ins><span class="cx">
</span><span class="cx"> // Alignment interval is increased to equal the time the page has been throttled, to a limit.
</span><span class="cx"> updateDOMTimerAlignmentInterval();
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.h (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.h        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/page/Page.h        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -240,7 +240,7 @@
</span><span class="cx"> ProgressTracker& progress() const { return *m_progress; }
</span><span class="cx"> BackForwardController& backForward() const { return *m_backForwardController; }
</span><span class="cx">
</span><del>- std::chrono::milliseconds domTimerAlignmentInterval() const { return m_timerAlignmentInterval; }
</del><ins>+ Seconds domTimerAlignmentInterval() const { return m_domTimerAlignmentInterval; }
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(VIEW_MODE_CSS_MEDIA)
</span><span class="cx"> enum ViewMode {
</span><span class="lines">@@ -552,7 +552,7 @@
</span><span class="cx"> void setShowAllPlugins(bool showAll) { m_showAllPlugins = showAll; }
</span><span class="cx"> bool showAllPlugins() const;
</span><span class="cx">
</span><del>- WEBCORE_EXPORT void setTimerAlignmentIntervalIncreaseLimit(std::chrono::milliseconds);
</del><ins>+ WEBCORE_EXPORT void setDOMTimerAlignmentIntervalIncreaseLimit(Seconds);
</ins><span class="cx">
</span><span class="cx"> bool isControlledByAutomation() const { return m_controlledByAutomation; }
</span><span class="cx"> void setControlledByAutomation(bool controlled) { m_controlledByAutomation = controlled; }
</span><span class="lines">@@ -609,7 +609,7 @@
</span><span class="cx"> void setTimerThrottlingState(TimerThrottlingState);
</span><span class="cx"> void updateTimerThrottlingState();
</span><span class="cx"> void updateDOMTimerAlignmentInterval();
</span><del>- void timerAlignmentIntervalIncreaseTimerFired();
</del><ins>+ void domTimerAlignmentIntervalIncreaseTimerFired();
</ins><span class="cx">
</span><span class="cx"> const std::unique_ptr<Chrome> m_chrome;
</span><span class="cx"> const std::unique_ptr<DragCaretController> m_dragCaretController;
</span><span class="lines">@@ -712,10 +712,10 @@
</span><span class="cx"> #endif // ENABLE(VIEW_MODE_CSS_MEDIA)
</span><span class="cx">
</span><span class="cx"> TimerThrottlingState m_timerThrottlingState { TimerThrottlingState::Disabled };
</span><del>- std::chrono::steady_clock::time_point m_timerThrottlingStateLastChangedTime { std::chrono::steady_clock::duration::zero() };
- std::chrono::milliseconds m_timerAlignmentInterval;
- Timer m_timerAlignmentIntervalIncreaseTimer;
- std::chrono::milliseconds m_timerAlignmentIntervalIncreaseLimit { 0 };
</del><ins>+ MonotonicTime m_timerThrottlingStateLastChangedTime;
+ Seconds m_domTimerAlignmentInterval;
+ Timer m_domTimerAlignmentIntervalIncreaseTimer;
+ Seconds m_domTimerAlignmentIntervalIncreaseLimit;
</ins><span class="cx">
</span><span class="cx"> bool m_isEditable;
</span><span class="cx"> bool m_isPrerender;
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.cpp (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.cpp        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/page/Settings.cpp        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -449,10 +449,9 @@
</span><span class="cx"> m_needsAdobeFrameReloadingQuirk = shouldNotReloadIFramesForUnchangedSRC;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void Settings::setMinimumDOMTimerInterval(std::chrono::milliseconds interval)
</del><ins>+void Settings::setMinimumDOMTimerInterval(Seconds interval)
</ins><span class="cx"> {
</span><del>- auto oldTimerInterval = m_minimumDOMTimerInterval;
- m_minimumDOMTimerInterval = interval;
</del><ins>+ auto oldTimerInterval = std::exchange(m_minimumDOMTimerInterval, interval);
</ins><span class="cx">
</span><span class="cx"> if (!m_page)
</span><span class="cx"> return;
</span><span class="lines">@@ -459,7 +458,7 @@
</span><span class="cx">
</span><span class="cx"> for (Frame* frame = &m_page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
</span><span class="cx"> if (frame->document())
</span><del>- frame->document()->adjustMinimumTimerInterval(oldTimerInterval);
</del><ins>+ frame->document()->adjustMinimumDOMTimerInterval(oldTimerInterval);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.h (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.h        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/page/Settings.h        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -169,8 +169,8 @@
</span><span class="cx"> WEBCORE_EXPORT void setNeedsAdobeFrameReloadingQuirk(bool);
</span><span class="cx"> bool needsAcrobatFrameReloadingQuirk() const { return m_needsAdobeFrameReloadingQuirk; }
</span><span class="cx">
</span><del>- WEBCORE_EXPORT void setMinimumDOMTimerInterval(std::chrono::milliseconds); // Initialized to DOMTimer::defaultMinimumInterval().
- std::chrono::milliseconds minimumDOMTimerInterval() const { return m_minimumDOMTimerInterval; }
</del><ins>+ WEBCORE_EXPORT void setMinimumDOMTimerInterval(Seconds); // Initialized to DOMTimer::defaultMinimumInterval().
+ Seconds minimumDOMTimerInterval() const { return m_minimumDOMTimerInterval; }
</ins><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT void setLayoutInterval(Seconds);
</span><span class="cx"> Seconds layoutInterval() const { return m_layoutInterval; }
</span><span class="lines">@@ -338,7 +338,7 @@
</span><span class="cx"> const std::unique_ptr<FontGenericFamilies> m_fontGenericFamilies;
</span><span class="cx"> SecurityOrigin::StorageBlockingPolicy m_storageBlockingPolicy;
</span><span class="cx"> Seconds m_layoutInterval;
</span><del>- std::chrono::milliseconds m_minimumDOMTimerInterval;
</del><ins>+ Seconds m_minimumDOMTimerInterval;
</ins><span class="cx">
</span><span class="cx"> SETTINGS_MEMBER_VARIABLES
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepageSuspendableTimerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/SuspendableTimer.h (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/SuspendableTimer.h        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/page/SuspendableTimer.h        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -29,6 +29,8 @@
</span><span class="cx"> #include "ActiveDOMObject.h"
</span><span class="cx"> #include "Timer.h"
</span><span class="cx">
</span><ins>+#include <wtf/Seconds.h>
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class SuspendableTimer : private TimerBase, public ActiveDOMObject {
</span><span class="lines">@@ -49,9 +51,20 @@
</span><span class="cx"> void augmentFireInterval(double delta);
</span><span class="cx"> void augmentRepeatInterval(double delta);
</span><span class="cx">
</span><ins>+ void startRepeating(Seconds repeatInterval) { startRepeating(repeatInterval.value()); }
+ void startOneShot(Seconds interval) { startOneShot(interval.value()); }
+
+ // FIXME: Use the overloads taking Seconds instead and drop these.
</ins><span class="cx"> void startRepeating(std::chrono::milliseconds repeatInterval) { startRepeating(msToSeconds(repeatInterval)); }
</span><span class="cx"> void startOneShot(std::chrono::milliseconds interval) { startOneShot(msToSeconds(interval)); }
</span><ins>+
</ins><span class="cx"> std::chrono::milliseconds repeatIntervalMS() const { return secondsToMS(repeatInterval()); }
</span><ins>+ Seconds repeatIntervalSeconds() const { return Seconds { repeatInterval() }; }
+
+ void augmentFireInterval(Seconds delta) { augmentFireInterval(delta.value()); }
+ void augmentRepeatInterval(Seconds delta) { augmentRepeatInterval(delta.value()); }
+
+ // FIXME: Use the overloads taking Seconds instead and drop these.
</ins><span class="cx"> void augmentFireInterval(std::chrono::milliseconds delta) { augmentFireInterval(msToSeconds(delta)); }
</span><span class="cx"> void augmentRepeatInterval(std::chrono::milliseconds delta) { augmentRepeatInterval(msToSeconds(delta)); }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformTimercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Timer.cpp (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Timer.cpp        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/platform/Timer.cpp        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -382,8 +382,8 @@
</span><span class="cx"> double oldTime = m_nextFireTime;
</span><span class="cx"> // Don't realign zero-delay timers.
</span><span class="cx"> if (newTime) {
</span><del>- if (auto newAlignedTime = alignedFireTime(secondsToMS(newTime)))
- newTime = msToSeconds(newAlignedTime.value());
</del><ins>+ if (auto newAlignedTime = alignedFireTime(Seconds { newTime }))
+ newTime = newAlignedTime.value().seconds();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (oldTime != newTime) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformTimerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Timer.h (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Timer.h        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/platform/Timer.h        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx"> private:
</span><span class="cx"> virtual void fired() = 0;
</span><span class="cx">
</span><del>- virtual std::optional<std::chrono::milliseconds> alignedFireTime(std::chrono::milliseconds) const { return std::nullopt; }
</del><ins>+ virtual std::optional<Seconds> alignedFireTime(Seconds) const { return std::nullopt; }
</ins><span class="cx">
</span><span class="cx"> void checkConsistency() const;
</span><span class="cx"> void checkHeapIndex() const;
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.cpp (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.cpp        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/testing/InternalSettings.cpp        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx"> , m_originalMockScrollbarsEnabled(settings.mockScrollbarsEnabled())
</span><span class="cx"> , m_imagesEnabled(settings.areImagesEnabled())
</span><span class="cx"> , m_preferMIMETypeForImages(settings.preferMIMETypeForImages())
</span><del>- , m_minimumTimerInterval(settings.minimumDOMTimerInterval())
</del><ins>+ , m_minimumDOMTimerInterval(settings.minimumDOMTimerInterval())
</ins><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> , m_shouldDisplaySubtitles(settings.shouldDisplaySubtitles())
</span><span class="cx"> , m_shouldDisplayCaptions(settings.shouldDisplayCaptions())
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx"> settings.setCanvasUsesAcceleratedDrawing(m_originalCanvasUsesAcceleratedDrawing);
</span><span class="cx"> settings.setImagesEnabled(m_imagesEnabled);
</span><span class="cx"> settings.setPreferMIMETypeForImages(m_preferMIMETypeForImages);
</span><del>- settings.setMinimumDOMTimerInterval(m_minimumTimerInterval);
</del><ins>+ settings.setMinimumDOMTimerInterval(m_minimumDOMTimerInterval);
</ins><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> settings.setShouldDisplaySubtitles(m_shouldDisplaySubtitles);
</span><span class="cx"> settings.setShouldDisplayCaptions(m_shouldDisplayCaptions);
</span><span class="lines">@@ -544,7 +544,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (!m_page)
</span><span class="cx"> return Exception { INVALID_ACCESS_ERR };
</span><del>- settings().setMinimumDOMTimerInterval(std::chrono::milliseconds((std::chrono::milliseconds::rep)(intervalInSeconds * 1000)));
</del><ins>+ settings().setMinimumDOMTimerInterval(Seconds { intervalInSeconds });
</ins><span class="cx"> return { };
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.h (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.h        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/testing/InternalSettings.h        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx"> bool m_originalUsesOverlayScrollbars;
</span><span class="cx"> bool m_imagesEnabled;
</span><span class="cx"> bool m_preferMIMETypeForImages;
</span><del>- std::chrono::milliseconds m_minimumTimerInterval;
</del><ins>+ Seconds m_minimumDOMTimerInterval;
</ins><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> bool m_shouldDisplaySubtitles;
</span><span class="cx"> bool m_shouldDisplayCaptions;
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/testing/Internals.cpp        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -1045,7 +1045,7 @@
</span><span class="cx"> if (timer->intervalClampedToMinimum() > timer->m_originalInterval)
</span><span class="cx"> return true;
</span><span class="cx">
</span><del>- return !!timer->alignedFireTime(0ms);
</del><ins>+ return !!timer->alignedFireTime(0_s);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool Internals::isRequestAnimationFrameThrottled() const
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerGlobalScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.cpp (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerGlobalScope.cpp        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.cpp        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -207,7 +207,7 @@
</span><span class="cx">
</span><span class="cx"> int WorkerGlobalScope::setTimeout(std::unique_ptr<ScheduledAction> action, int timeout)
</span><span class="cx"> {
</span><del>- return DOMTimer::install(*this, WTFMove(action), std::chrono::milliseconds(timeout), true);
</del><ins>+ return DOMTimer::install(*this, WTFMove(action), Seconds::fromMilliseconds(timeout), true);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WorkerGlobalScope::clearTimeout(int timeoutId)
</span><span class="lines">@@ -217,7 +217,7 @@
</span><span class="cx">
</span><span class="cx"> int WorkerGlobalScope::setInterval(std::unique_ptr<ScheduledAction> action, int timeout)
</span><span class="cx"> {
</span><del>- return DOMTimer::install(*this, WTFMove(action), std::chrono::milliseconds(timeout), false);
</del><ins>+ return DOMTimer::install(*this, WTFMove(action), Seconds::fromMilliseconds(timeout), false);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WorkerGlobalScope::clearInterval(int timeoutId)
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebView.cpp (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebView.cpp        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebKit/win/WebView.cpp        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -7467,7 +7467,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (!interval)
</span><span class="cx"> return E_POINTER;
</span><del>- *interval = DOMTimer::defaultMinimumInterval().count() / 1000.;
</del><ins>+ *interval = DOMTimer::defaultMinimumInterval().seconds();
</ins><span class="cx"> return S_OK;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -7476,8 +7476,7 @@
</span><span class="cx"> if (!m_page)
</span><span class="cx"> return E_FAIL;
</span><span class="cx">
</span><del>- auto intervalMS = std::chrono::milliseconds((std::chrono::milliseconds::rep)(interval * 1000));
- page()->settings().setMinimumDOMTimerInterval(intervalMS);
</del><ins>+ page()->settings().setMinimumDOMTimerInterval(Seconds { interval });
</ins><span class="cx"> return S_OK;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebKit2/ChangeLog        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2017-03-07 Chris Dumez <cdumez@apple.com>
+
+ Port DOMTimer from std::chrono::milliseconds to WTF::Seconds type
+ https://bugs.webkit.org/show_bug.cgi?id=169236
+
+ Reviewed by Simon Fraser.
+
+ * UIProcess/WebProcessPool.cpp:
+ (WebKit::WebProcessPool::updateHiddenPageThrottlingAutoIncreaseLimit):
+ * WebProcess/WebPage/WebPage.h:
+ (WebKit::WebPage::setHiddenPageDOMTimerThrottlingIncreaseLimit):
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::setHiddenPageDOMTimerThrottlingIncreaseLimit):
+ * WebProcess/WebProcess.h:
+ * WebProcess/WebProcess.messages.in:
+
</ins><span class="cx"> 2017-03-06 Aakash Jain <aakash_jain@apple.com>
</span><span class="cx">
</span><span class="cx"> Enable SUPPORTS_TEXT_BASED_API in WebKit2 for iOS
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -1465,7 +1465,7 @@
</span><span class="cx"> static int maximumTimerThrottlePerPageInMS = 200 * 100;
</span><span class="cx">
</span><span class="cx"> int limitInMilliseconds = maximumTimerThrottlePerPageInMS * m_hiddenPageThrottlingAutoIncreasesCounter.value();
</span><del>- sendToAllProcesses(Messages::WebProcess::SetHiddenPageTimerThrottlingIncreaseLimit(limitInMilliseconds));
</del><ins>+ sendToAllProcesses(Messages::WebProcess::SetHiddenPageDOMTimerThrottlingIncreaseLimit(limitInMilliseconds));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebProcessPool::reportWebContentCPUTime(int64_t cpuTime, uint64_t activityState)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -303,9 +303,9 @@
</span><span class="cx"> bool isAlwaysOnLoggingAllowed() const;
</span><span class="cx"> void setActivePopupMenu(WebPopupMenu*);
</span><span class="cx">
</span><del>- void setHiddenPageTimerThrottlingIncreaseLimit(std::chrono::milliseconds limit)
</del><ins>+ void setHiddenPageDOMTimerThrottlingIncreaseLimit(Seconds limit)
</ins><span class="cx"> {
</span><del>- m_page->setTimerAlignmentIntervalIncreaseLimit(limit);
</del><ins>+ m_page->setDOMTimerAlignmentIntervalIncreaseLimit(limit);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(INPUT_TYPE_COLOR)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -1235,10 +1235,10 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebProcess::setHiddenPageTimerThrottlingIncreaseLimit(int milliseconds)
</del><ins>+void WebProcess::setHiddenPageDOMTimerThrottlingIncreaseLimit(int milliseconds)
</ins><span class="cx"> {
</span><span class="cx"> for (auto& page : m_pageMap.values())
</span><del>- page->setHiddenPageTimerThrottlingIncreaseLimit(std::chrono::milliseconds(milliseconds));
</del><ins>+ page->setHiddenPageDOMTimerThrottlingIncreaseLimit(Seconds::fromMilliseconds(milliseconds));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if !PLATFORM(COCOA)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.h        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -195,7 +195,7 @@
</span><span class="cx">
</span><span class="cx"> void updateActivePages();
</span><span class="cx">
</span><del>- void setHiddenPageTimerThrottlingIncreaseLimit(int milliseconds);
</del><ins>+ void setHiddenPageDOMTimerThrottlingIncreaseLimit(int milliseconds);
</ins><span class="cx">
</span><span class="cx"> void processWillSuspendImminently(bool& handled);
</span><span class="cx"> void prepareToSuspend();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.messages.in (213518 => 213519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.messages.in        2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.messages.in        2017-03-07 17:11:06 UTC (rev 213519)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> DeleteWebsiteData(WebCore::SessionID sessionID, OptionSet<WebKit::WebsiteDataType> websiteDataTypes, std::chrono::system_clock::time_point modifiedSince) -> ()
</span><span class="cx"> DeleteWebsiteDataForOrigins(WebCore::SessionID sessionID, OptionSet<WebKit::WebsiteDataType> websiteDataTypes, Vector<WebCore::SecurityOriginData> origins) -> ()
</span><span class="cx">
</span><del>- SetHiddenPageTimerThrottlingIncreaseLimit(int milliseconds)
</del><ins>+ SetHiddenPageDOMTimerThrottlingIncreaseLimit(int milliseconds)
</ins><span class="cx"> SetProcessSuppressionEnabled(bool flag)
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> SetQOS(int latencyQOS, int throughputQOS)
</span></span></pre>
</div>
</div>
</body>
</html>