<!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>[215143] 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/215143">215143</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2017-04-08 10:09:09 -0700 (Sat, 08 Apr 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Timer's nextFireInterval() / repeatInterval() should return Seconds
https://bugs.webkit.org/show_bug.cgi?id=170639

Reviewed by Simon Fraser.

Timer's nextFireInterval() / repeatInterval() should return Seconds, not double.

Source/WebCore:

* loader/NavigationScheduler.cpp:
* page/DOMTimer.cpp:
(WebCore::DOMTimer::updateTimerIntervalIfNecessary):
* page/SuspendableTimer.cpp:
(WebCore::SuspendableTimer::suspend):
(WebCore::SuspendableTimer::repeatInterval):
* page/SuspendableTimer.h:
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::timeToNextService):
(WebCore::AnimationBase::getTimeToNextEvent):
(WebCore::AnimationBase::goIntoEndingOrLoopingState):
* page/animation/AnimationBase.h:
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::updateAnimations):
(WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForRenderer):
(WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
(WebCore::CSSAnimationControllerPrivate::animationFrameCallbackFired):
* page/animation/CSSAnimationControllerPrivate.h:
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::timeToNextService):
* page/animation/CompositeAnimation.h:
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::timeToNextService):
* page/animation/ImplicitAnimation.h:
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::timeToNextService):
* page/animation/KeyframeAnimation.h:
* platform/ThreadTimers.cpp:
(WebCore::ThreadTimers::sharedTimerFiredInternal):
* platform/Timer.cpp:
(WebCore::TimerBase::nextFireInterval):
* platform/Timer.h:
(WebCore::TimerBase::repeatInterval):
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setIsInWindow):
(WebCore::TileController::scheduleTileRevalidation):
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::revalidateTiles):

Source/WebKit2:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::layerVolatilityTimerFired):
(WebKit::WebPage::markLayersVolatile):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreloaderNavigationSchedulercpp">trunk/Source/WebCore/loader/NavigationScheduler.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMTimercpp">trunk/Source/WebCore/page/DOMTimer.cpp</a></li>
<li><a href="#trunkSourceWebCorepageSuspendableTimercpp">trunk/Source/WebCore/page/SuspendableTimer.cpp</a></li>
<li><a href="#trunkSourceWebCorepageSuspendableTimerh">trunk/Source/WebCore/page/SuspendableTimer.h</a></li>
<li><a href="#trunkSourceWebCorepageanimationAnimationBasecpp">trunk/Source/WebCore/page/animation/AnimationBase.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationAnimationBaseh">trunk/Source/WebCore/page/animation/AnimationBase.h</a></li>
<li><a href="#trunkSourceWebCorepageanimationCSSAnimationControllercpp">trunk/Source/WebCore/page/animation/CSSAnimationController.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationCSSAnimationControllerPrivateh">trunk/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h</a></li>
<li><a href="#trunkSourceWebCorepageanimationCompositeAnimationcpp">trunk/Source/WebCore/page/animation/CompositeAnimation.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationCompositeAnimationh">trunk/Source/WebCore/page/animation/CompositeAnimation.h</a></li>
<li><a href="#trunkSourceWebCorepageanimationImplicitAnimationcpp">trunk/Source/WebCore/page/animation/ImplicitAnimation.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationImplicitAnimationh">trunk/Source/WebCore/page/animation/ImplicitAnimation.h</a></li>
<li><a href="#trunkSourceWebCorepageanimationKeyframeAnimationcpp">trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationKeyframeAnimationh">trunk/Source/WebCore/page/animation/KeyframeAnimation.h</a></li>
<li><a href="#trunkSourceWebCoreplatformThreadTimerscpp">trunk/Source/WebCore/platform/ThreadTimers.cpp</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="#trunkSourceWebCoreplatformgraphicscaTileControllercpp">trunk/Source/WebCore/platform/graphics/ca/TileController.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaTileControllerh">trunk/Source/WebCore/platform/graphics/ca/TileController.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaTileGridcpp">trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/ChangeLog        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2017-04-08  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Timer's nextFireInterval() / repeatInterval() should return Seconds
+        https://bugs.webkit.org/show_bug.cgi?id=170639
+
+        Reviewed by Simon Fraser.
+
+        Timer's nextFireInterval() / repeatInterval() should return Seconds, not double.
+
+        * loader/NavigationScheduler.cpp:
+        * page/DOMTimer.cpp:
+        (WebCore::DOMTimer::updateTimerIntervalIfNecessary):
+        * page/SuspendableTimer.cpp:
+        (WebCore::SuspendableTimer::suspend):
+        (WebCore::SuspendableTimer::repeatInterval):
+        * page/SuspendableTimer.h:
+        * page/animation/AnimationBase.cpp:
+        (WebCore::AnimationBase::timeToNextService):
+        (WebCore::AnimationBase::getTimeToNextEvent):
+        (WebCore::AnimationBase::goIntoEndingOrLoopingState):
+        * page/animation/AnimationBase.h:
+        * page/animation/CSSAnimationController.cpp:
+        (WebCore::CSSAnimationControllerPrivate::updateAnimations):
+        (WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForRenderer):
+        (WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
+        (WebCore::CSSAnimationControllerPrivate::animationFrameCallbackFired):
+        * page/animation/CSSAnimationControllerPrivate.h:
+        * page/animation/CompositeAnimation.cpp:
+        (WebCore::CompositeAnimation::timeToNextService):
+        * page/animation/CompositeAnimation.h:
+        * page/animation/ImplicitAnimation.cpp:
+        (WebCore::ImplicitAnimation::timeToNextService):
+        * page/animation/ImplicitAnimation.h:
+        * page/animation/KeyframeAnimation.cpp:
+        (WebCore::KeyframeAnimation::timeToNextService):
+        * page/animation/KeyframeAnimation.h:
+        * platform/ThreadTimers.cpp:
+        (WebCore::ThreadTimers::sharedTimerFiredInternal):
+        * platform/Timer.cpp:
+        (WebCore::TimerBase::nextFireInterval):
+        * platform/Timer.h:
+        (WebCore::TimerBase::repeatInterval):
+        * platform/graphics/ca/TileController.cpp:
+        (WebCore::TileController::setIsInWindow):
+        (WebCore::TileController::scheduleTileRevalidation):
+        * platform/graphics/ca/TileController.h:
+        * platform/graphics/ca/TileGrid.cpp:
+        (WebCore::TileGrid::revalidateTiles):
+
</ins><span class="cx"> 2017-04-08  Csaba Osztrogonác  &lt;ossy@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed Mac cmake buildfix after r215051, just for fun.
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderNavigationSchedulercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/NavigationScheduler.cpp (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/NavigationScheduler.cpp        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/loader/NavigationScheduler.cpp        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx">         m_haveToldClient = true;
</span><span class="cx"> 
</span><span class="cx">         UserGestureIndicator gestureIndicator(userGestureToForward());
</span><del>-        frame.loader().clientRedirected(m_url, delay(), currentTime() + timer.nextFireInterval(), lockBackForwardList());
</del><ins>+        frame.loader().clientRedirected(m_url, delay(), currentTime() + timer.nextFireInterval().value(), lockBackForwardList());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     void didStopTimer(Frame&amp; frame, bool newLoadInProgress) override
</span><span class="lines">@@ -278,7 +278,7 @@
</span><span class="cx">         m_haveToldClient = true;
</span><span class="cx"> 
</span><span class="cx">         UserGestureIndicator gestureIndicator(userGestureToForward());
</span><del>-        frame.loader().clientRedirected(m_submission-&gt;requestURL(), delay(), currentTime() + timer.nextFireInterval(), lockBackForwardList());
</del><ins>+        frame.loader().clientRedirected(m_submission-&gt;requestURL(), delay(), currentTime() + timer.nextFireInterval().value(), lockBackForwardList());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     void didStopTimer(Frame&amp; frame, bool newLoadInProgress) override
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMTimercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMTimer.cpp (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMTimer.cpp        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/page/DOMTimer.cpp        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -400,7 +400,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (repeatInterval()) {
</span><del>-        ASSERT(repeatIntervalSeconds() == previousInterval);
</del><ins>+        ASSERT(repeatInterval() == previousInterval);
</ins><span class="cx">         LOG(DOMTimers, &quot;%p - Updating DOMTimer's repeat interval from %.2f ms to %.2f ms due to throttling.&quot;, this, previousInterval.milliseconds(), m_currentTimerInterval.milliseconds());
</span><span class="cx">         augmentRepeatInterval(m_currentTimerInterval - previousInterval);
</span><span class="cx">     } else {
</span></span></pre></div>
<a id="trunkSourceWebCorepageSuspendableTimercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/SuspendableTimer.cpp (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/SuspendableTimer.cpp        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/page/SuspendableTimer.cpp        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx">     m_savedIsActive = TimerBase::isActive();
</span><span class="cx">     if (m_savedIsActive) {
</span><span class="cx">         m_savedNextFireInterval = TimerBase::nextUnalignedFireInterval();
</span><del>-        m_savedRepeatInterval = TimerBase::repeatIntervalSeconds();
</del><ins>+        m_savedRepeatInterval = TimerBase::repeatInterval();
</ins><span class="cx">         TimerBase::stop();
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -119,13 +119,13 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-double SuspendableTimer::repeatInterval() const
</del><ins>+Seconds SuspendableTimer::repeatInterval() const
</ins><span class="cx"> {
</span><span class="cx">     if (!m_suspended)
</span><span class="cx">         return TimerBase::repeatInterval();
</span><span class="cx">     if (m_savedIsActive)
</span><del>-        return m_savedRepeatInterval.value();
-    return 0;
</del><ins>+        return m_savedRepeatInterval;
+    return 0_s;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SuspendableTimer::augmentFireInterval(Seconds delta)
</span></span></pre></div>
<a id="trunkSourceWebCorepageSuspendableTimerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/SuspendableTimer.h (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/SuspendableTimer.h        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/page/SuspendableTimer.h        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx">     void startRepeating(double repeatInterval) { startRepeating(Seconds { repeatInterval }); }
</span><span class="cx">     void startOneShot(double interval) { startOneShot(Seconds { interval }); }
</span><span class="cx"> 
</span><del>-    double repeatInterval() const;
</del><ins>+    Seconds repeatInterval() const;
</ins><span class="cx">     void augmentFireInterval(double delta) { augmentFireInterval(Seconds { delta }); }
</span><span class="cx">     void augmentRepeatInterval(double delta) { augmentRepeatInterval(Seconds { delta }); }
</span><span class="cx"> 
</span><span class="lines">@@ -59,9 +59,6 @@
</span><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><span class="cx"> 
</span><del>-    std::chrono::milliseconds repeatIntervalMS() const { return secondsToMS(repeatInterval()); }
-    Seconds repeatIntervalSeconds() const { return Seconds { repeatInterval() }; }
-
</del><span class="cx">     void augmentFireInterval(Seconds delta);
</span><span class="cx">     void augmentRepeatInterval(Seconds delta);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationAnimationBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/AnimationBase.cpp (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/AnimationBase.cpp        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/page/animation/AnimationBase.cpp        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -564,12 +564,12 @@
</span><span class="cx">     updateStateMachine(pause ?  AnimationStateInput::PlayStatePaused : AnimationStateInput::PlayStateRunning, -1);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-double AnimationBase::timeToNextService()
</del><ins>+std::optional&lt;Seconds&gt; AnimationBase::timeToNextService()
</ins><span class="cx"> {
</span><del>-    // Returns the time at which next service is required. -1 means no service is required. 0 means 
</del><ins>+    // Returns the time at which next service is required. std::nullopt means no service is required. 0 means
</ins><span class="cx">     // service is required now, and &gt; 0 means service is required that many seconds in the future.
</span><span class="cx">     if (paused() || isNew() || postActive() || fillingForwards())
</span><del>-        return -1;
</del><ins>+        return std::nullopt;
</ins><span class="cx">     
</span><span class="cx">     if (m_animationState == AnimationState::StartWaitTimer) {
</span><span class="cx"> #if ENABLE(CSS_ANIMATIONS_LEVEL_2)
</span><span class="lines">@@ -578,19 +578,19 @@
</span><span class="cx">                 float currentScrollPosition = m_object-&gt;view().frameView().scrollPositionForFixedPosition().y().toFloat();
</span><span class="cx">                 auto&amp; scrollTrigger = downcast&lt;ScrollAnimationTrigger&gt;(*m_animation-&gt;trigger());
</span><span class="cx">                 if (currentScrollPosition &gt;= scrollTrigger.startValue().value() &amp;&amp; (!scrollTrigger.hasEndValue() || currentScrollPosition &lt;= scrollTrigger.endValue().value()))
</span><del>-                    return 0;
</del><ins>+                    return 0_s;
</ins><span class="cx">             }
</span><del>-            return -1;
</del><ins>+            return std::nullopt;
</ins><span class="cx">         }
</span><span class="cx"> #endif
</span><span class="cx">         double timeFromNow = m_animation-&gt;delay() - (beginAnimationUpdateTime() - m_requestedStartTime);
</span><del>-        return std::max(timeFromNow, 0.0);
</del><ins>+        return std::max(Seconds { timeFromNow }, 0_s);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     fireAnimationEventsIfNeeded();
</span><span class="cx">         
</span><span class="cx">     // In all other cases, we need service right away.
</span><del>-    return 0;
</del><ins>+    return 0_s;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Compute the fractional time, taking into account direction.
</span><span class="lines">@@ -675,7 +675,7 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AnimationBase::getTimeToNextEvent(double&amp; time, bool&amp; isLooping) const
</del><ins>+void AnimationBase::getTimeToNextEvent(Seconds&amp; time, bool&amp; isLooping) const
</ins><span class="cx"> {
</span><span class="cx">     // Decide when the end or loop event needs to fire
</span><span class="cx">     const double elapsedDuration = std::max(beginAnimationUpdateTime() - m_startTime, 0.0);
</span><span class="lines">@@ -696,12 +696,12 @@
</span><span class="cx">         isLooping = false;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    time = durationLeft;
</del><ins>+    time = Seconds { durationLeft };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AnimationBase::goIntoEndingOrLoopingState()
</span><span class="cx"> {
</span><del>-    double t;
</del><ins>+    Seconds t;
</ins><span class="cx">     bool isLooping;
</span><span class="cx">     getTimeToNextEvent(t, isLooping);
</span><span class="cx">     LOG(Animations, &quot;%p AnimationState %s -&gt; %s&quot;, this, nameForState(m_animationState), isLooping ? &quot;Looping&quot; : &quot;Ending&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationAnimationBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/AnimationBase.h (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/AnimationBase.h        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/page/animation/AnimationBase.h        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -129,7 +129,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool isAccelerated() const { return m_isAccelerated; }
</span><span class="cx"> 
</span><del>-    virtual double timeToNextService();
</del><ins>+    virtual std::optional&lt;Seconds&gt; timeToNextService();
</ins><span class="cx"> 
</span><span class="cx">     double progress(double scale = 1, double offset = 0, const TimingFunction* = nullptr) const;
</span><span class="cx"> 
</span><span class="lines">@@ -232,7 +232,7 @@
</span><span class="cx"> 
</span><span class="cx">     static void setNeedsStyleRecalc(Element*);
</span><span class="cx">     
</span><del>-    void getTimeToNextEvent(double&amp; time, bool&amp; isLooping) const;
</del><ins>+    void getTimeToNextEvent(Seconds&amp; time, bool&amp; isLooping) const;
</ins><span class="cx"> 
</span><span class="cx">     double fractionalTime(double scale, double elapsedTime, double offset) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationCSSAnimationControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/CSSAnimationController.cpp (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/CSSAnimationController.cpp        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/page/animation/CSSAnimationController.cpp        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -123,19 +123,19 @@
</span><span class="cx">     return animation-&gt;isSuspended();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-double CSSAnimationControllerPrivate::updateAnimations(SetChanged callSetChanged/* = DoNotCallSetChanged*/)
</del><ins>+std::optional&lt;Seconds&gt; CSSAnimationControllerPrivate::updateAnimations(SetChanged callSetChanged/* = DoNotCallSetChanged*/)
</ins><span class="cx"> {
</span><span class="cx">     AnimationPrivateUpdateBlock updateBlock(*this);
</span><del>-    double timeToNextService = -1;
</del><ins>+    std::optional&lt;Seconds&gt; timeToNextService;
</ins><span class="cx">     bool calledSetChanged = false;
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; compositeAnimation : m_compositeAnimations) {
</span><span class="cx">         CompositeAnimation&amp; animation = *compositeAnimation.value;
</span><span class="cx">         if (!animation.isSuspended() &amp;&amp; animation.hasAnimations()) {
</span><del>-            double t = animation.timeToNextService();
-            if (t != -1 &amp;&amp; (t &lt; timeToNextService || timeToNextService == -1))
-                timeToNextService = t;
-            if (!timeToNextService) {
</del><ins>+            std::optional&lt;Seconds&gt; t = animation.timeToNextService();
+            if (t &amp;&amp; (!timeToNextService || t.value() &lt; timeToNextService.value()))
+                timeToNextService = t.value();
+            if (timeToNextService &amp;&amp; timeToNextService.value() == 0_s) {
</ins><span class="cx">                 if (callSetChanged != CallSetChanged)
</span><span class="cx">                     break;
</span><span class="cx">                 Element* element = compositeAnimation.key-&gt;element();
</span><span class="lines">@@ -155,44 +155,47 @@
</span><span class="cx"> 
</span><span class="cx"> void CSSAnimationControllerPrivate::updateAnimationTimerForRenderer(RenderElement&amp; renderer)
</span><span class="cx"> {
</span><del>-    double timeToNextService = 0;
</del><ins>+    std::optional&lt;Seconds&gt; timeToNextService;
</ins><span class="cx"> 
</span><span class="cx">     const CompositeAnimation* compositeAnimation = m_compositeAnimations.get(&amp;renderer);
</span><span class="cx">     if (!compositeAnimation-&gt;isSuspended() &amp;&amp; compositeAnimation-&gt;hasAnimations())
</span><span class="cx">         timeToNextService = compositeAnimation-&gt;timeToNextService();
</span><span class="cx"> 
</span><del>-    if (m_animationTimer.isActive() &amp;&amp; (m_animationTimer.repeatInterval() || m_animationTimer.nextFireInterval() &lt;= timeToNextService))
</del><ins>+    if (!timeToNextService)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_animationTimer.startOneShot(timeToNextService);
</del><ins>+    if (m_animationTimer.isActive() &amp;&amp; (m_animationTimer.repeatInterval() || m_animationTimer.nextFireInterval() &lt;= timeToNextService.value()))
+        return;
+
+    m_animationTimer.startOneShot(timeToNextService.value());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CSSAnimationControllerPrivate::updateAnimationTimer(SetChanged callSetChanged/* = DoNotCallSetChanged*/)
</span><span class="cx"> {
</span><del>-    double timeToNextService = updateAnimations(callSetChanged);
</del><ins>+    std::optional&lt;Seconds&gt; timeToNextService = updateAnimations(callSetChanged);
</ins><span class="cx"> 
</span><del>-    LOG(Animations, &quot;updateAnimationTimer: timeToNextService is %.2f&quot;, timeToNextService);
</del><ins>+    LOG(Animations, &quot;updateAnimationTimer: timeToNextService is %.2f&quot;, timeToNextService.value_or(Seconds { -1 }).value());
</ins><span class="cx"> 
</span><ins>+    // If we don't need service, we want to make sure the timer is no longer running
+    if (!timeToNextService) {
+        if (m_animationTimer.isActive())
+            m_animationTimer.stop();
+        return;
+    }
+
</ins><span class="cx">     // If we want service immediately, we start a repeating timer to reduce the overhead of starting
</span><del>-    if (!timeToNextService) {
</del><ins>+    if (!timeToNextService.value()) {
</ins><span class="cx">         auto* page = m_frame.page();
</span><span class="cx">         bool shouldThrottle = page &amp;&amp; page-&gt;isLowPowerModeEnabled();
</span><span class="cx">         Seconds delay = shouldThrottle ? animationTimerThrottledDelay : animationTimerDelay;
</span><span class="cx"> 
</span><del>-        if (!m_animationTimer.isActive() || m_animationTimer.repeatInterval() != delay.value())
</del><ins>+        if (!m_animationTimer.isActive() || m_animationTimer.repeatInterval() != delay)
</ins><span class="cx">             m_animationTimer.startRepeating(delay);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // If we don't need service, we want to make sure the timer is no longer running
-    if (timeToNextService &lt; 0) {
-        if (m_animationTimer.isActive())
-            m_animationTimer.stop();
-        return;
-    }
-
</del><span class="cx">     // Otherwise, we want to start a one-shot timer so we get here again
</span><del>-    m_animationTimer.startOneShot(timeToNextService);
</del><ins>+    m_animationTimer.startOneShot(timeToNextService.value());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CSSAnimationControllerPrivate::updateStyleIfNeededDispatcherFired()
</span><span class="lines">@@ -247,9 +250,9 @@
</span><span class="cx"> 
</span><span class="cx"> void CSSAnimationControllerPrivate::animationFrameCallbackFired()
</span><span class="cx"> {
</span><del>-    double timeToNextService = updateAnimations(CallSetChanged);
</del><ins>+    std::optional&lt;Seconds&gt; timeToNextService = updateAnimations(CallSetChanged);
</ins><span class="cx"> 
</span><del>-    if (timeToNextService &gt;= 0)
</del><ins>+    if (timeToNextService)
</ins><span class="cx">         m_frame.document()-&gt;view()-&gt;scheduleAnimation();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationCSSAnimationControllerPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">     ~CSSAnimationControllerPrivate();
</span><span class="cx"> 
</span><span class="cx">     // Returns the time until the next animation needs to be serviced, or -1 if there are none.
</span><del>-    double updateAnimations(SetChanged callSetChanged = DoNotCallSetChanged);
</del><ins>+    std::optional&lt;Seconds&gt; updateAnimations(SetChanged callSetChanged = DoNotCallSetChanged);
</ins><span class="cx">     void updateAnimationTimer(SetChanged callSetChanged = DoNotCallSetChanged);
</span><span class="cx"> 
</span><span class="cx">     CompositeAnimation&amp; ensureCompositeAnimation(RenderElement&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationCompositeAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/CompositeAnimation.cpp (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/CompositeAnimation.cpp        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/page/animation/CompositeAnimation.cpp        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -366,33 +366,33 @@
</span><span class="cx">     return resultStyle;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-double CompositeAnimation::timeToNextService() const
</del><ins>+std::optional&lt;Seconds&gt; CompositeAnimation::timeToNextService() const
</ins><span class="cx"> {
</span><del>-    // Returns the time at which next service is required. -1 means no service is required. 0 means 
</del><ins>+    // Returns the time at which next service is required. std::nullopt means no service is required. 0 means
</ins><span class="cx">     // service is required now, and &gt; 0 means service is required that many seconds in the future.
</span><del>-    double minT = -1;
</del><ins>+    std::optional&lt;Seconds&gt; minT;
</ins><span class="cx">     
</span><span class="cx">     if (!m_transitions.isEmpty()) {
</span><span class="cx">         for (auto&amp; transition : m_transitions.values()) {
</span><del>-            double t = transition-&gt;timeToNextService();
-            if (t == -1)
</del><ins>+            std::optional&lt;Seconds&gt; t = transition-&gt;timeToNextService();
+            if (!t)
</ins><span class="cx">                 continue;
</span><del>-            if (t &lt; minT || minT == -1)
-                minT = t;
-            if (minT == 0)
-                return 0;
</del><ins>+            if (!minT || t.value() &lt; minT.value())
+                minT = t.value();
+            if (minT.value() == 0_s)
+                return 0_s;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     if (!m_keyframeAnimations.isEmpty()) {
</span><span class="cx">         m_keyframeAnimations.checkConsistency();
</span><span class="cx">         for (auto&amp; animation : m_keyframeAnimations.values()) {
</span><del>-            double t = animation-&gt;timeToNextService();
-            if (t == -1)
</del><ins>+            std::optional&lt;Seconds&gt; t = animation-&gt;timeToNextService();
+            if (!t)
</ins><span class="cx">                 continue;
</span><del>-            if (t &lt; minT || minT == -1)
-                minT = t;
-            if (minT == 0)
-                return 0;
</del><ins>+            if (!minT || t.value() &lt; minT.value())
+                minT = t.value();
+            if (minT.value() == 0_s)
+                return 0_s;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationCompositeAnimationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/CompositeAnimation.h (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/CompositeAnimation.h        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/page/animation/CompositeAnimation.h        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">     std::unique_ptr&lt;RenderStyle&gt; getAnimatedStyle() const;
</span><span class="cx">     bool computeExtentOfTransformAnimation(LayoutRect&amp;) const;
</span><span class="cx"> 
</span><del>-    double timeToNextService() const;
</del><ins>+    std::optional&lt;Seconds&gt; timeToNextService() const;
</ins><span class="cx">     
</span><span class="cx">     CSSAnimationControllerPrivate&amp; animationController() const { return m_animationController; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationImplicitAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/ImplicitAnimation.cpp (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/ImplicitAnimation.cpp        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/page/animation/ImplicitAnimation.cpp        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -315,17 +315,17 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-double ImplicitAnimation::timeToNextService()
</del><ins>+std::optional&lt;Seconds&gt; ImplicitAnimation::timeToNextService()
</ins><span class="cx"> {
</span><del>-    double t = AnimationBase::timeToNextService();
-    if (t != 0 || preActive())
</del><ins>+    std::optional&lt;Seconds&gt; t = AnimationBase::timeToNextService();
+    if (!t || t.value() != 0_s || preActive())
</ins><span class="cx">         return t;
</span><del>-        
</del><ins>+
</ins><span class="cx">     // A return value of 0 means we need service. But if this is an accelerated animation we 
</span><span class="cx">     // only need service at the end of the transition.
</span><span class="cx">     if (CSSPropertyAnimation::animationOfPropertyIsAccelerated(m_animatingProperty) &amp;&amp; isAccelerated()) {
</span><span class="cx">         bool isLooping;
</span><del>-        getTimeToNextEvent(t, isLooping);
</del><ins>+        getTimeToNextEvent(t.value(), isLooping);
</ins><span class="cx">     }
</span><span class="cx">     return t;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationImplicitAnimationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/ImplicitAnimation.h (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/ImplicitAnimation.h        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/page/animation/ImplicitAnimation.h        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx"> 
</span><span class="cx">     void blendPropertyValueInStyle(CSSPropertyID, RenderStyle*);
</span><span class="cx"> 
</span><del>-    double timeToNextService() override;
</del><ins>+    std::optional&lt;Seconds&gt; timeToNextService() override;
</ins><span class="cx">     
</span><span class="cx">     bool active() const { return m_active; }
</span><span class="cx">     void setActive(bool b) { m_active = b; }
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationKeyframeAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -490,14 +490,14 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-double KeyframeAnimation::timeToNextService()
</del><ins>+std::optional&lt;Seconds&gt; KeyframeAnimation::timeToNextService()
</ins><span class="cx"> {
</span><del>-    double t = AnimationBase::timeToNextService();
-    if (t != 0 || preActive())
</del><ins>+    std::optional&lt;Seconds&gt; t = AnimationBase::timeToNextService();
+    if (!t || t.value() != 0_s || preActive())
</ins><span class="cx">         return t;
</span><del>-        
</del><ins>+
</ins><span class="cx">     // A return value of 0 means we need service. But if we only have accelerated animations we 
</span><del>-    // only need service at the end of the transition
</del><ins>+    // only need service at the end of the transition.
</ins><span class="cx">     bool acceleratedPropertiesOnly = true;
</span><span class="cx">     
</span><span class="cx">     for (auto propertyID : m_keyframes.properties()) {
</span><span class="lines">@@ -509,7 +509,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (acceleratedPropertiesOnly) {
</span><span class="cx">         bool isLooping;
</span><del>-        getTimeToNextEvent(t, isLooping);
</del><ins>+        getTimeToNextEvent(t.value(), isLooping);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return t;
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationKeyframeAnimationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/KeyframeAnimation.h (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/KeyframeAnimation.h        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/page/animation/KeyframeAnimation.h        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx">     void setUnanimatedStyle(std::unique_ptr&lt;RenderStyle&gt; style) { m_unanimatedStyle = WTFMove(style); }
</span><span class="cx">     RenderStyle* unanimatedStyle() const { return m_unanimatedStyle.get(); }
</span><span class="cx"> 
</span><del>-    double timeToNextService() override;
</del><ins>+    std::optional&lt;Seconds&gt; timeToNextService() override;
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     void onAnimationStart(double elapsedTime) override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformThreadTimerscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ThreadTimers.cpp (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ThreadTimers.cpp        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/platform/ThreadTimers.cpp        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx">         timer-&gt;m_unalignedNextFireTime = MonotonicTime { };
</span><span class="cx">         timer-&gt;heapDeleteMin();
</span><span class="cx"> 
</span><del>-        Seconds interval = timer-&gt;repeatIntervalSeconds();
</del><ins>+        Seconds interval = timer-&gt;repeatInterval();
</ins><span class="cx">         timer-&gt;setNextFireTime(interval ? fireTime + interval : MonotonicTime { });
</span><span class="cx"> 
</span><span class="cx">         // Once the timer has been fired, it may be deleted, so do nothing else with it after this point.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformTimercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Timer.cpp (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Timer.cpp        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/platform/Timer.cpp        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -226,13 +226,13 @@
</span><span class="cx">     ASSERT(!inHeap());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-double TimerBase::nextFireInterval() const
</del><ins>+Seconds TimerBase::nextFireInterval() const
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(isActive());
</span><span class="cx">     MonotonicTime current = MonotonicTime::now();
</span><span class="cx">     if (m_nextFireTime &lt; current)
</span><del>-        return 0;
-    return (m_nextFireTime - current).value();
</del><ins>+        return 0_s;
+    return m_nextFireTime - current;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline void TimerBase::checkHeapIndex() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformTimerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Timer.h (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Timer.h        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/platform/Timer.h        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -70,11 +70,9 @@
</span><span class="cx">     WEBCORE_EXPORT void stop();
</span><span class="cx">     bool isActive() const;
</span><span class="cx"> 
</span><del>-    double nextFireInterval() const; // FIXME: Should return Seconds.
</del><ins>+    Seconds nextFireInterval() const;
</ins><span class="cx">     Seconds nextUnalignedFireInterval() const;
</span><del>-    double repeatInterval() const { return m_repeatInterval.value(); } // FIXME: Should return Seconds.
-    Seconds repeatIntervalSeconds() const { return m_repeatInterval; } // FIXME: Remove once repeatInterval() returns Seconds.
-    std::chrono::milliseconds repeatIntervalMS() const { return secondsToMS(repeatInterval()); }
</del><ins>+    Seconds repeatInterval() const { return m_repeatInterval; }
</ins><span class="cx"> 
</span><span class="cx">     void augmentFireInterval(Seconds delta) { setNextFireTime(m_nextFireTime + delta); }
</span><span class="cx">     void augmentFireInterval(std::chrono::milliseconds delta) { augmentFireInterval(msToSeconds(delta)); }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaTileControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.cpp (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/TileController.cpp        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.cpp        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -285,7 +285,7 @@
</span><span class="cx">     if (m_isInWindow)
</span><span class="cx">         setNeedsRevalidateTiles();
</span><span class="cx">     else {
</span><del>-        const double tileRevalidationTimeout = 4;
</del><ins>+        const Seconds tileRevalidationTimeout = 4_s;
</ins><span class="cx">         scheduleTileRevalidation(tileRevalidationTimeout);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -480,7 +480,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TileController::scheduleTileRevalidation(double interval)
</del><ins>+void TileController::scheduleTileRevalidation(Seconds interval)
</ins><span class="cx"> {
</span><span class="cx">     if (m_tileRevalidationTimer.isActive() &amp;&amp; m_tileRevalidationTimer.nextFireInterval() &lt; interval)
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaTileControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.h (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/TileController.h        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.h        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include &lt;wtf/Deque.h&gt;
</span><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><ins>+#include &lt;wtf/Seconds.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -141,7 +142,7 @@
</span><span class="cx"> private:
</span><span class="cx">     TileGrid&amp; tileGrid() { return *m_tileGrid; }
</span><span class="cx"> 
</span><del>-    void scheduleTileRevalidation(double interval);
</del><ins>+    void scheduleTileRevalidation(Seconds interval);
</ins><span class="cx"> 
</span><span class="cx">     float topContentInset() const { return m_topContentInset; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaTileGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -365,7 +365,7 @@
</span><span class="cx">     TileCohort currCohort = nextTileCohort();
</span><span class="cx">     unsigned tilesInCohort = 0;
</span><span class="cx"> 
</span><del>-    double minimumRevalidationTimerDuration = std::numeric_limits&lt;double&gt;::max();
</del><ins>+    Seconds minimumRevalidationTimerDuration = Seconds::infinity();
</ins><span class="cx">     bool needsTileRevalidation = false;
</span><span class="cx">     
</span><span class="cx">     auto tileSize = m_controller.tileSize();
</span><span class="lines">@@ -404,7 +404,7 @@
</span><span class="cx">                         continue;
</span><span class="cx">                     double timeUntilCohortExpires = cohort.timeUntilExpiration();
</span><span class="cx">                     if (timeUntilCohortExpires &gt; 0) {
</span><del>-                        minimumRevalidationTimerDuration = std::min(minimumRevalidationTimerDuration, timeUntilCohortExpires);
</del><ins>+                        minimumRevalidationTimerDuration = std::min(minimumRevalidationTimerDuration, Seconds { timeUntilCohortExpires });
</ins><span class="cx">                         needsTileRevalidation = true;
</span><span class="cx">                     } else
</span><span class="cx">                         tileLayer-&gt;removeFromSuperlayer();
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebKit2/ChangeLog        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2017-04-08  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Timer's nextFireInterval() / repeatInterval() should return Seconds
+        https://bugs.webkit.org/show_bug.cgi?id=170639
+
+        Reviewed by Simon Fraser.
+
+        Timer's nextFireInterval() / repeatInterval() should return Seconds, not double.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::layerVolatilityTimerFired):
+        (WebKit::WebPage::markLayersVolatile):
+
</ins><span class="cx"> 2017-04-07  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Modernize WebPage.h
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (215142 => 215143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2017-04-08 13:43:10 UTC (rev 215142)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2017-04-08 17:09:09 UTC (rev 215143)
</span><span class="lines">@@ -254,8 +254,8 @@
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> static const double pageScrollHysteresisSeconds = 0.3;
</span><del>-static const std::chrono::milliseconds initialLayerVolatilityTimerInterval { 20 };
-static const std::chrono::seconds maximumLayerVolatilityTimerInterval { 2 };
</del><ins>+static const Seconds initialLayerVolatilityTimerInterval { 20_ms };
+static const Seconds maximumLayerVolatilityTimerInterval { 2_s };
</ins><span class="cx"> 
</span><span class="cx"> #define RELEASE_LOG_IF_ALLOWED(...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), Layers, __VA_ARGS__)
</span><span class="cx"> #define RELEASE_LOG_ERROR_IF_ALLOWED(...) RELEASE_LOG_ERROR_IF(isAlwaysOnLoggingAllowed(), Layers, __VA_ARGS__)
</span><span class="lines">@@ -2164,7 +2164,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebPage::layerVolatilityTimerFired()
</span><span class="cx"> {
</span><del>-    auto newInterval = 2 * m_layerVolatilityTimer.repeatIntervalMS();
</del><ins>+    Seconds newInterval = m_layerVolatilityTimer.repeatInterval() * 2.;
</ins><span class="cx">     bool didSucceed = markLayersVolatileImmediatelyIfPossible();
</span><span class="cx">     if (didSucceed || newInterval &gt; maximumLayerVolatilityTimerInterval) {
</span><span class="cx">         m_layerVolatilityTimer.stop();
</span><span class="lines">@@ -2173,7 +2173,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RELEASE_LOG_ERROR_IF_ALLOWED(&quot;%p - WebPage - Failed to mark all layers as volatile, will retry in %lld ms&quot;, this, static_cast&lt;long long&gt;(newInterval.count()));
</del><ins>+    RELEASE_LOG_ERROR_IF_ALLOWED(&quot;%p - WebPage - Failed to mark all layers as volatile, will retry in %g ms&quot;, this, newInterval.value() * 1000);
</ins><span class="cx">     m_layerVolatilityTimer.startRepeating(newInterval);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2204,7 +2204,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RELEASE_LOG_IF_ALLOWED(&quot;%p - Failed to mark all layers as volatile, will retry in %lld ms&quot;, this, initialLayerVolatilityTimerInterval.count());
</del><ins>+    RELEASE_LOG_IF_ALLOWED(&quot;%p - Failed to mark all layers as volatile, will retry in %g ms&quot;, this, initialLayerVolatilityTimerInterval.value() * 1000);
</ins><span class="cx">     m_layerVolatilityTimer.startRepeating(initialLayerVolatilityTimerInterval);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>