<!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>[215136] 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/215136">215136</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2017-04-07 18:33:55 -0700 (Fri, 07 Apr 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Start using MonotonicTime / Seconds in Timer class
https://bugs.webkit.org/show_bug.cgi?id=170625

Reviewed by Simon Fraser.

Source/WebCore:

Start using MonotonicTime / Seconds in Timer class. More work will be needed
for the transition to be complete. I plan to do this in a follow-up.

* page/DOMTimer.cpp:
(WebCore::DOMTimer::alignedFireTime):
* page/DOMTimer.h:
* page/SuspendableTimer.cpp:
(WebCore::SuspendableTimer::suspend):
(WebCore::SuspendableTimer::startRepeating):
(WebCore::SuspendableTimer::startOneShot):
(WebCore::SuspendableTimer::repeatInterval):
(WebCore::SuspendableTimer::augmentFireInterval):
(WebCore::SuspendableTimer::augmentRepeatInterval):
* page/SuspendableTimer.h:
(WebCore::SuspendableTimer::startRepeating):
(WebCore::SuspendableTimer::startOneShot):
(WebCore::SuspendableTimer::augmentFireInterval):
(WebCore::SuspendableTimer::augmentRepeatInterval):
* platform/ThreadTimers.cpp:
(WebCore::ThreadTimers::ThreadTimers):
(WebCore::ThreadTimers::setSharedTimer):
(WebCore::ThreadTimers::updateSharedTimer):
(WebCore::ThreadTimers::sharedTimerFiredInternal):
(WebCore::ThreadTimers::fireTimersInNestedEventLoop):
* platform/ThreadTimers.h:
* platform/Timer.cpp:
(WebCore::TimerHeapLessThanFunction::operator()):
(WebCore::TimerBase::TimerBase):
(WebCore::TimerBase::start):
(WebCore::TimerBase::stop):
(WebCore::TimerBase::nextFireInterval):
(WebCore::TimerBase::heapPop):
(WebCore::TimerBase::updateHeapIfNeeded):
(WebCore::TimerBase::setNextFireTime):
(WebCore::TimerBase::nextUnalignedFireInterval):
* platform/Timer.h:
(WebCore::TimerBase::start):
(WebCore::TimerBase::startOneShot):
(WebCore::TimerBase::repeatInterval):
(WebCore::TimerBase::repeatIntervalSeconds):
(WebCore::TimerBase::augmentFireInterval):
(WebCore::TimerBase::augmentRepeatInterval):
(WebCore::TimerBase::alignedFireTime):
(WebCore::TimerBase::isActive):
* testing/Internals.cpp:
(WebCore::Internals::isTimerThrottled):

Source/WTF:

Add modulo operator to MonotonicTime.

* wtf/MonotonicTime.h:
(WTF::MonotonicTime::operator%):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfMonotonicTimeh">trunk/Source/WTF/wtf/MonotonicTime.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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="#trunkSourceWebCorepageSuspendableTimercpp">trunk/Source/WebCore/page/SuspendableTimer.cpp</a></li>
<li><a href="#trunkSourceWebCorepageSuspendableTimerh">trunk/Source/WebCore/page/SuspendableTimer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformThreadTimerscpp">trunk/Source/WebCore/platform/ThreadTimers.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformThreadTimersh">trunk/Source/WebCore/platform/ThreadTimers.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="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (215135 => 215136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2017-04-08 01:15:09 UTC (rev 215135)
+++ trunk/Source/WTF/ChangeLog        2017-04-08 01:33:55 UTC (rev 215136)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2017-04-07  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Start using MonotonicTime / Seconds in Timer class
+        https://bugs.webkit.org/show_bug.cgi?id=170625
+
+        Reviewed by Simon Fraser.
+
+        Add modulo operator to MonotonicTime.
+
+        * wtf/MonotonicTime.h:
+        (WTF::MonotonicTime::operator%):
+
</ins><span class="cx"> 2017-04-07  Keith Miller  &lt;keith_miller@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add a PriorityQueue class
</span></span></pre></div>
<a id="trunkSourceWTFwtfMonotonicTimeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/MonotonicTime.h (215135 => 215136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/MonotonicTime.h        2017-04-08 01:15:09 UTC (rev 215135)
+++ trunk/Source/WTF/wtf/MonotonicTime.h        2017-04-08 01:33:55 UTC (rev 215136)
</span><span class="lines">@@ -78,6 +78,11 @@
</span><span class="cx">     {
</span><span class="cx">         return fromRawSeconds(m_value - other.value());
</span><span class="cx">     }
</span><ins>+
+    Seconds operator%(Seconds other) const
+    {
+        return Seconds { fmod(m_value, other.value()) };
+    }
</ins><span class="cx">     
</span><span class="cx">     // Time is a scalar and scalars can be negated as this could arise from algebraic
</span><span class="cx">     // transformations. So, we allow it.
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (215135 => 215136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-04-08 01:15:09 UTC (rev 215135)
+++ trunk/Source/WebCore/ChangeLog        2017-04-08 01:33:55 UTC (rev 215136)
</span><span class="lines">@@ -1,3 +1,57 @@
</span><ins>+2017-04-07  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Start using MonotonicTime / Seconds in Timer class
+        https://bugs.webkit.org/show_bug.cgi?id=170625
+
+        Reviewed by Simon Fraser.
+
+        Start using MonotonicTime / Seconds in Timer class. More work will be needed
+        for the transition to be complete. I plan to do this in a follow-up.
+
+        * page/DOMTimer.cpp:
+        (WebCore::DOMTimer::alignedFireTime):
+        * page/DOMTimer.h:
+        * page/SuspendableTimer.cpp:
+        (WebCore::SuspendableTimer::suspend):
+        (WebCore::SuspendableTimer::startRepeating):
+        (WebCore::SuspendableTimer::startOneShot):
+        (WebCore::SuspendableTimer::repeatInterval):
+        (WebCore::SuspendableTimer::augmentFireInterval):
+        (WebCore::SuspendableTimer::augmentRepeatInterval):
+        * page/SuspendableTimer.h:
+        (WebCore::SuspendableTimer::startRepeating):
+        (WebCore::SuspendableTimer::startOneShot):
+        (WebCore::SuspendableTimer::augmentFireInterval):
+        (WebCore::SuspendableTimer::augmentRepeatInterval):
+        * platform/ThreadTimers.cpp:
+        (WebCore::ThreadTimers::ThreadTimers):
+        (WebCore::ThreadTimers::setSharedTimer):
+        (WebCore::ThreadTimers::updateSharedTimer):
+        (WebCore::ThreadTimers::sharedTimerFiredInternal):
+        (WebCore::ThreadTimers::fireTimersInNestedEventLoop):
+        * platform/ThreadTimers.h:
+        * platform/Timer.cpp:
+        (WebCore::TimerHeapLessThanFunction::operator()):
+        (WebCore::TimerBase::TimerBase):
+        (WebCore::TimerBase::start):
+        (WebCore::TimerBase::stop):
+        (WebCore::TimerBase::nextFireInterval):
+        (WebCore::TimerBase::heapPop):
+        (WebCore::TimerBase::updateHeapIfNeeded):
+        (WebCore::TimerBase::setNextFireTime):
+        (WebCore::TimerBase::nextUnalignedFireInterval):
+        * platform/Timer.h:
+        (WebCore::TimerBase::start):
+        (WebCore::TimerBase::startOneShot):
+        (WebCore::TimerBase::repeatInterval):
+        (WebCore::TimerBase::repeatIntervalSeconds):
+        (WebCore::TimerBase::augmentFireInterval):
+        (WebCore::TimerBase::augmentRepeatInterval):
+        (WebCore::TimerBase::alignedFireTime):
+        (WebCore::TimerBase::isActive):
+        * testing/Internals.cpp:
+        (WebCore::Internals::isTimerThrottled):
+
</ins><span class="cx"> 2017-04-07  Yuichiro Kikura  &lt;y.kikura@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebGPU: implement ComputeCommandEncoder and related components
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMTimercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMTimer.cpp (215135 => 215136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMTimer.cpp        2017-04-08 01:15:09 UTC (rev 215135)
+++ trunk/Source/WebCore/page/DOMTimer.cpp        2017-04-08 01:33:55 UTC (rev 215136)
</span><span class="lines">@@ -427,7 +427,7 @@
</span><span class="cx">     return interval;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::optional&lt;Seconds&gt; DOMTimer::alignedFireTime(Seconds fireTime) const
</del><ins>+std::optional&lt;MonotonicTime&gt; DOMTimer::alignedFireTime(MonotonicTime fireTime) const
</ins><span class="cx"> {
</span><span class="cx">     Seconds alignmentInterval = scriptExecutionContext()-&gt;domTimerAlignmentInterval(m_nestingLevel &gt;= maxTimerNestingLevel);
</span><span class="cx">     if (!alignmentInterval)
</span><span class="lines">@@ -438,7 +438,7 @@
</span><span class="cx">     // Force alignment to randomizedAlignment fraction of the way between alignemntIntervals, e.g.
</span><span class="cx">     // if alignmentInterval is 10_ms and randomizedAlignment is 0.3 this will align to 3, 13, 23, ...
</span><span class="cx">     Seconds randomizedOffset = alignmentInterval * randomizedProportion;
</span><del>-    Seconds adjustedFireTime = fireTime - randomizedOffset;
</del><ins>+    MonotonicTime 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 (215135 => 215136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMTimer.h        2017-04-08 01:15:09 UTC (rev 215135)
+++ trunk/Source/WebCore/page/DOMTimer.h        2017-04-08 01:33:55 UTC (rev 215136)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;SuspendableTimer.h&quot;
</span><span class="cx"> #include &quot;UserGestureIndicator.h&quot;
</span><span class="cx"> #include &lt;memory&gt;
</span><ins>+#include &lt;wtf/MonotonicTime.h&gt;
</ins><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> #include &lt;wtf/Seconds.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -74,7 +75,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&lt;Seconds&gt; alignedFireTime(Seconds) const override;
</del><ins>+    WEBCORE_EXPORT std::optional&lt;MonotonicTime&gt; alignedFireTime(MonotonicTime) const override;
</ins><span class="cx"> 
</span><span class="cx">     // ActiveDOMObject API.
</span><span class="cx">     const char* activeDOMObjectName() const override;
</span></span></pre></div>
<a id="trunkSourceWebCorepageSuspendableTimercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/SuspendableTimer.cpp (215135 => 215136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/SuspendableTimer.cpp        2017-04-08 01:15:09 UTC (rev 215135)
+++ trunk/Source/WebCore/page/SuspendableTimer.cpp        2017-04-08 01:33:55 UTC (rev 215136)
</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::repeatInterval();
</del><ins>+        m_savedRepeatInterval = TimerBase::repeatIntervalSeconds();
</ins><span class="cx">         TimerBase::stop();
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx">         m_suspended = false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SuspendableTimer::startRepeating(double repeatInterval)
</del><ins>+void SuspendableTimer::startRepeating(Seconds repeatInterval)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_suspended)
</span><span class="cx">         TimerBase::startRepeating(repeatInterval);
</span><span class="lines">@@ -108,7 +108,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SuspendableTimer::startOneShot(double interval)
</del><ins>+void SuspendableTimer::startOneShot(Seconds interval)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_suspended)
</span><span class="cx">         TimerBase::startOneShot(interval);
</span><span class="lines">@@ -115,7 +115,7 @@
</span><span class="cx">     else {
</span><span class="cx">         m_savedIsActive = true;
</span><span class="cx">         m_savedNextFireInterval = interval;
</span><del>-        m_savedRepeatInterval = 0;
</del><ins>+        m_savedRepeatInterval = 0_s;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -124,11 +124,11 @@
</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;
</del><ins>+        return m_savedRepeatInterval.value();
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SuspendableTimer::augmentFireInterval(double delta)
</del><ins>+void SuspendableTimer::augmentFireInterval(Seconds delta)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_suspended)
</span><span class="cx">         TimerBase::augmentFireInterval(delta);
</span><span class="lines">@@ -137,11 +137,11 @@
</span><span class="cx">     } else {
</span><span class="cx">         m_savedIsActive = true;
</span><span class="cx">         m_savedNextFireInterval = delta;
</span><del>-        m_savedRepeatInterval = 0;
</del><ins>+        m_savedRepeatInterval = 0_s;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SuspendableTimer::augmentRepeatInterval(double delta)
</del><ins>+void SuspendableTimer::augmentRepeatInterval(Seconds delta)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_suspended)
</span><span class="cx">         TimerBase::augmentRepeatInterval(delta);
</span></span></pre></div>
<a id="trunkSourceWebCorepageSuspendableTimerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/SuspendableTimer.h (215135 => 215136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/SuspendableTimer.h        2017-04-08 01:15:09 UTC (rev 215135)
+++ trunk/Source/WebCore/page/SuspendableTimer.h        2017-04-08 01:33:55 UTC (rev 215136)
</span><span class="lines">@@ -45,14 +45,15 @@
</span><span class="cx">     bool isActive() const { return TimerBase::isActive() || (m_suspended &amp;&amp; m_savedIsActive); }
</span><span class="cx">     bool isSuspended() const { return m_suspended; }
</span><span class="cx"> 
</span><del>-    void startRepeating(double repeatInterval);
-    void startOneShot(double interval);
</del><ins>+    void startRepeating(double repeatInterval) { startRepeating(Seconds { repeatInterval }); }
+    void startOneShot(double interval) { startOneShot(Seconds { interval }); }
+
</ins><span class="cx">     double repeatInterval() const;
</span><del>-    void augmentFireInterval(double delta);
-    void augmentRepeatInterval(double delta);
</del><ins>+    void augmentFireInterval(double delta) { augmentFireInterval(Seconds { delta }); }
+    void augmentRepeatInterval(double delta) { augmentRepeatInterval(Seconds { delta }); }
</ins><span class="cx"> 
</span><del>-    void startRepeating(Seconds repeatInterval) { startRepeating(repeatInterval.value()); }
-    void startOneShot(Seconds interval) { startOneShot(interval.value()); }
</del><ins>+    void startRepeating(Seconds repeatInterval);
+    void startOneShot(Seconds interval);
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: Use the overloads taking Seconds instead and drop these.
</span><span class="cx">     void startRepeating(std::chrono::milliseconds repeatInterval) { startRepeating(msToSeconds(repeatInterval)); }
</span><span class="lines">@@ -61,8 +62,8 @@
</span><span class="cx">     std::chrono::milliseconds repeatIntervalMS() const { return secondsToMS(repeatInterval()); }
</span><span class="cx">     Seconds repeatIntervalSeconds() const { return Seconds { repeatInterval() }; }
</span><span class="cx"> 
</span><del>-    void augmentFireInterval(Seconds delta) { augmentFireInterval(delta.value()); }
-    void augmentRepeatInterval(Seconds delta) { augmentRepeatInterval(delta.value()); }
</del><ins>+    void augmentFireInterval(Seconds delta);
+    void augmentRepeatInterval(Seconds delta);
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: Use the overloads taking Seconds instead and drop these.
</span><span class="cx">     void augmentFireInterval(std::chrono::milliseconds delta) { augmentFireInterval(msToSeconds(delta)); }
</span><span class="lines">@@ -84,8 +85,8 @@
</span><span class="cx">     void suspend(ReasonForSuspension) final;
</span><span class="cx">     void resume() final;
</span><span class="cx"> 
</span><del>-    double m_savedNextFireInterval { 0 };
-    double m_savedRepeatInterval { 0 };
</del><ins>+    Seconds m_savedNextFireInterval;
+    Seconds m_savedRepeatInterval;
</ins><span class="cx"> 
</span><span class="cx">     bool m_suspended { false };
</span><span class="cx">     bool m_savedIsActive { false };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformThreadTimerscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ThreadTimers.cpp (215135 => 215136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ThreadTimers.cpp        2017-04-08 01:15:09 UTC (rev 215135)
+++ trunk/Source/WebCore/platform/ThreadTimers.cpp        2017-04-08 01:33:55 UTC (rev 215136)
</span><span class="lines">@@ -43,15 +43,12 @@
</span><span class="cx"> // Fire timers for this length of time, and then quit to let the run loop process user input events.
</span><span class="cx"> // 100ms is about a perceptable delay in UI, so use a half of that as a threshold.
</span><span class="cx"> // This is to prevent UI freeze when there are too many timers or machine performance is low.
</span><del>-static const double maxDurationOfFiringTimers = 0.050;
</del><ins>+static const Seconds maxDurationOfFiringTimers { 50_ms };
</ins><span class="cx"> 
</span><span class="cx"> // Timers are created, started and fired on the same thread, and each thread has its own ThreadTimers
</span><span class="cx"> // copy to keep the heap and a set of currently firing timers.
</span><span class="cx"> 
</span><span class="cx"> ThreadTimers::ThreadTimers()
</span><del>-    : m_sharedTimer(0)
-    , m_firingTimers(false)
-    , m_pendingSharedTimerFireTime(0)
</del><span class="cx"> {
</span><span class="cx">     if (isUIThread())
</span><span class="cx">         setSharedTimer(&amp;MainThreadSharedTimer::singleton());
</span><span class="lines">@@ -64,7 +61,7 @@
</span><span class="cx">     if (m_sharedTimer) {
</span><span class="cx">         m_sharedTimer-&gt;setFiredFunction(nullptr);
</span><span class="cx">         m_sharedTimer-&gt;stop();
</span><del>-        m_pendingSharedTimerFireTime = 0;
</del><ins>+        m_pendingSharedTimerFireTime = MonotonicTime { };
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     m_sharedTimer = sharedTimer;
</span><span class="lines">@@ -81,11 +78,11 @@
</span><span class="cx">         return;
</span><span class="cx">         
</span><span class="cx">     if (m_firingTimers || m_timerHeap.isEmpty()) {
</span><del>-        m_pendingSharedTimerFireTime = 0;
</del><ins>+        m_pendingSharedTimerFireTime = MonotonicTime { };
</ins><span class="cx">         m_sharedTimer-&gt;stop();
</span><span class="cx">     } else {
</span><del>-        double nextFireTime = m_timerHeap.first()-&gt;m_nextFireTime;
-        double currentMonotonicTime = monotonicallyIncreasingTime();
</del><ins>+        MonotonicTime nextFireTime = m_timerHeap.first()-&gt;m_nextFireTime;
+        MonotonicTime currentMonotonicTime = MonotonicTime::now();
</ins><span class="cx">         if (m_pendingSharedTimerFireTime) {
</span><span class="cx">             // No need to restart the timer if both the pending fire time and the new fire time are in the past.
</span><span class="cx">             if (m_pendingSharedTimerFireTime &lt;= currentMonotonicTime &amp;&amp; nextFireTime &lt;= currentMonotonicTime)
</span><span class="lines">@@ -92,7 +89,7 @@
</span><span class="cx">                 return;
</span><span class="cx">         } 
</span><span class="cx">         m_pendingSharedTimerFireTime = nextFireTime;
</span><del>-        m_sharedTimer-&gt;setFireInterval(Seconds(std::max(nextFireTime - currentMonotonicTime, 0.0)));
</del><ins>+        m_sharedTimer-&gt;setFireInterval(std::max(nextFireTime - currentMonotonicTime, 0_s));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -103,25 +100,25 @@
</span><span class="cx">     if (m_firingTimers)
</span><span class="cx">         return;
</span><span class="cx">     m_firingTimers = true;
</span><del>-    m_pendingSharedTimerFireTime = 0;
</del><ins>+    m_pendingSharedTimerFireTime = MonotonicTime { };
</ins><span class="cx"> 
</span><del>-    double fireTime = monotonicallyIncreasingTime();
-    double timeToQuit = fireTime + maxDurationOfFiringTimers;
</del><ins>+    MonotonicTime fireTime = MonotonicTime::now();
+    MonotonicTime timeToQuit = fireTime + maxDurationOfFiringTimers;
</ins><span class="cx"> 
</span><span class="cx">     while (!m_timerHeap.isEmpty() &amp;&amp; m_timerHeap.first()-&gt;m_nextFireTime &lt;= fireTime) {
</span><span class="cx">         TimerBase* timer = m_timerHeap.first();
</span><del>-        timer-&gt;m_nextFireTime = 0;
-        timer-&gt;m_unalignedNextFireTime = 0;
</del><ins>+        timer-&gt;m_nextFireTime = MonotonicTime { };
+        timer-&gt;m_unalignedNextFireTime = MonotonicTime { };
</ins><span class="cx">         timer-&gt;heapDeleteMin();
</span><span class="cx"> 
</span><del>-        double interval = timer-&gt;repeatInterval();
-        timer-&gt;setNextFireTime(interval ? fireTime + interval : 0);
</del><ins>+        Seconds interval = timer-&gt;repeatIntervalSeconds();
+        timer-&gt;setNextFireTime(interval ? fireTime + interval : MonotonicTime { });
</ins><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 class="cx">         timer-&gt;fired();
</span><span class="cx"> 
</span><span class="cx">         // Catch the case where the timer asked timers to fire in a nested event loop, or we are over time limit.
</span><del>-        if (!m_firingTimers || timeToQuit &lt; monotonicallyIncreasingTime())
</del><ins>+        if (!m_firingTimers || timeToQuit &lt; MonotonicTime::now())
</ins><span class="cx">             break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -137,7 +134,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_sharedTimer) {
</span><span class="cx">         m_sharedTimer-&gt;invalidate();
</span><del>-        m_pendingSharedTimerFireTime = 0;
</del><ins>+        m_pendingSharedTimerFireTime = MonotonicTime { };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     updateSharedTimer();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformThreadTimersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ThreadTimers.h (215135 => 215136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ThreadTimers.h        2017-04-08 01:15:09 UTC (rev 215135)
+++ trunk/Source/WebCore/platform/ThreadTimers.h        2017-04-08 01:33:55 UTC (rev 215136)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #ifndef ThreadTimers_h
</span><span class="cx"> #define ThreadTimers_h
</span><span class="cx"> 
</span><ins>+#include &lt;wtf/MonotonicTime.h&gt;
</ins><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -54,9 +55,9 @@
</span><span class="cx">         void fireTimersInNestedEventLoopInternal();
</span><span class="cx"> 
</span><span class="cx">         Vector&lt;TimerBase*&gt; m_timerHeap;
</span><del>-        SharedTimer* m_sharedTimer; // External object, can be a run loop on a worker thread. Normally set/reset by worker thread.
-        bool m_firingTimers; // Reentrancy guard.
-        double m_pendingSharedTimerFireTime;
</del><ins>+        SharedTimer* m_sharedTimer { nullptr }; // External object, can be a run loop on a worker thread. Normally set/reset by worker thread.
+        bool m_firingTimers { false }; // Reentrancy guard.
+        MonotonicTime m_pendingSharedTimerFireTime;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformTimercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Timer.cpp (215135 => 215136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Timer.cpp        2017-04-08 01:15:09 UTC (rev 215135)
+++ trunk/Source/WebCore/platform/Timer.cpp        2017-04-08 01:33:55 UTC (rev 215136)
</span><span class="lines">@@ -172,8 +172,8 @@
</span><span class="cx"> {
</span><span class="cx">     // The comparisons below are &quot;backwards&quot; because the heap puts the largest 
</span><span class="cx">     // element first and we want the lowest time to be the first one in the heap.
</span><del>-    double aFireTime = a-&gt;m_nextFireTime;
-    double bFireTime = b-&gt;m_nextFireTime;
</del><ins>+    MonotonicTime aFireTime = a-&gt;m_nextFireTime;
+    MonotonicTime bFireTime = b-&gt;m_nextFireTime;
</ins><span class="cx">     if (bFireTime != aFireTime)
</span><span class="cx">         return bFireTime &lt; aFireTime;
</span><span class="cx">     
</span><span class="lines">@@ -186,14 +186,8 @@
</span><span class="cx"> // ----------------
</span><span class="cx"> 
</span><span class="cx"> TimerBase::TimerBase()
</span><del>-    : m_nextFireTime(0)
-    , m_unalignedNextFireTime(0)
-    , m_repeatInterval(0)
-    , m_heapIndex(-1)
-    , m_cachedThreadGlobalTimerHeap(0)
</del><span class="cx"> #ifndef NDEBUG
</span><del>-    , m_thread(currentThread())
-    , m_wasDeleted(false)
</del><ins>+    : m_thread(currentThread())
</ins><span class="cx"> #endif
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -207,12 +201,12 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TimerBase::start(double nextFireInterval, double repeatInterval)
</del><ins>+void TimerBase::start(Seconds nextFireInterval, Seconds repeatInterval)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(canAccessThreadLocalDataForThread(m_thread));
</span><span class="cx"> 
</span><span class="cx">     m_repeatInterval = repeatInterval;
</span><del>-    setNextFireTime(monotonicallyIncreasingTime() + nextFireInterval);
</del><ins>+    setNextFireTime(MonotonicTime::now() + nextFireInterval);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TimerBase::stop()
</span><span class="lines">@@ -219,11 +213,11 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(canAccessThreadLocalDataForThread(m_thread));
</span><span class="cx"> 
</span><del>-    m_repeatInterval = 0;
-    setNextFireTime(0);
</del><ins>+    m_repeatInterval = 0_s;
+    setNextFireTime(MonotonicTime { });
</ins><span class="cx"> 
</span><del>-    ASSERT(m_nextFireTime == 0);
-    ASSERT(m_repeatInterval == 0);
</del><ins>+    ASSERT(!static_cast&lt;bool&gt;(m_nextFireTime));
+    ASSERT(m_repeatInterval == 0_s);
</ins><span class="cx">     ASSERT(!inHeap());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -230,10 +224,10 @@
</span><span class="cx"> double TimerBase::nextFireInterval() const
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isActive());
</span><del>-    double current = monotonicallyIncreasingTime();
</del><ins>+    MonotonicTime current = MonotonicTime::now();
</ins><span class="cx">     if (m_nextFireTime &lt; current)
</span><span class="cx">         return 0;
</span><del>-    return m_nextFireTime - current;
</del><ins>+    return (m_nextFireTime - current).value();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline void TimerBase::checkHeapIndex() const
</span><span class="lines">@@ -248,7 +242,7 @@
</span><span class="cx"> inline void TimerBase::checkConsistency() const
</span><span class="cx"> {
</span><span class="cx">     // Timers should be in the heap if and only if they have a non-zero next fire time.
</span><del>-    ASSERT(inHeap() == (m_nextFireTime != 0));
</del><ins>+    ASSERT(inHeap() == static_cast&lt;bool&gt;(m_nextFireTime));
</ins><span class="cx">     if (inHeap())
</span><span class="cx">         checkHeapIndex();
</span><span class="cx"> }
</span><span class="lines">@@ -255,7 +249,7 @@
</span><span class="cx"> 
</span><span class="cx"> void TimerBase::heapDecreaseKey()
</span><span class="cx"> {
</span><del>-    ASSERT(m_nextFireTime != 0);
</del><ins>+    ASSERT(static_cast&lt;bool&gt;(m_nextFireTime));
</ins><span class="cx">     checkHeapIndex();
</span><span class="cx">     TimerBase** heapData = timerHeap().data();
</span><span class="cx">     push_heap(TimerHeapIterator(heapData), TimerHeapIterator(heapData + m_heapIndex + 1), TimerHeapLessThanFunction());
</span><span class="lines">@@ -264,7 +258,7 @@
</span><span class="cx"> 
</span><span class="cx"> inline void TimerBase::heapDelete()
</span><span class="cx"> {
</span><del>-    ASSERT(m_nextFireTime == 0);
</del><ins>+    ASSERT(!static_cast&lt;bool&gt;(m_nextFireTime));
</ins><span class="cx">     heapPop();
</span><span class="cx">     timerHeap().removeLast();
</span><span class="cx">     m_heapIndex = -1;
</span><span class="lines">@@ -272,7 +266,7 @@
</span><span class="cx"> 
</span><span class="cx"> void TimerBase::heapDeleteMin()
</span><span class="cx"> {
</span><del>-    ASSERT(m_nextFireTime == 0);
</del><ins>+    ASSERT(!static_cast&lt;bool&gt;(m_nextFireTime));
</ins><span class="cx">     heapPopMin();
</span><span class="cx">     timerHeap().removeLast();
</span><span class="cx">     m_heapIndex = -1;
</span><span class="lines">@@ -280,7 +274,7 @@
</span><span class="cx"> 
</span><span class="cx"> inline void TimerBase::heapIncreaseKey()
</span><span class="cx"> {
</span><del>-    ASSERT(m_nextFireTime != 0);
</del><ins>+    ASSERT(static_cast&lt;bool&gt;(m_nextFireTime));
</ins><span class="cx">     heapPop();
</span><span class="cx">     heapDecreaseKey();
</span><span class="cx"> }
</span><span class="lines">@@ -296,8 +290,8 @@
</span><span class="cx"> inline void TimerBase::heapPop()
</span><span class="cx"> {
</span><span class="cx">     // Temporarily force this timer to have the minimum key so we can pop it.
</span><del>-    double fireTime = m_nextFireTime;
-    m_nextFireTime = -std::numeric_limits&lt;double&gt;::infinity();
</del><ins>+    MonotonicTime fireTime = m_nextFireTime;
+    m_nextFireTime = -MonotonicTime::infinity();
</ins><span class="cx">     heapDecreaseKey();
</span><span class="cx">     heapPopMin();
</span><span class="cx">     m_nextFireTime = fireTime;
</span><span class="lines">@@ -347,7 +341,7 @@
</span><span class="cx">     return childHeapPropertyHolds(this, heap, childIndex1) &amp;&amp; childHeapPropertyHolds(this, heap, childIndex2);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TimerBase::updateHeapIfNeeded(double oldTime)
</del><ins>+void TimerBase::updateHeapIfNeeded(MonotonicTime oldTime)
</ins><span class="cx"> {
</span><span class="cx">     if (m_nextFireTime &amp;&amp; hasValidHeapPosition())
</span><span class="cx">         return;
</span><span class="lines">@@ -366,7 +360,7 @@
</span><span class="cx">     ASSERT(!inHeap() || hasValidHeapPosition());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TimerBase::setNextFireTime(double newTime)
</del><ins>+void TimerBase::setNextFireTime(MonotonicTime newTime)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(canAccessThreadLocalDataForThread(m_thread));
</span><span class="cx">     ASSERT(!m_wasDeleted);
</span><span class="lines">@@ -379,11 +373,11 @@
</span><span class="cx">         m_cachedThreadGlobalTimerHeap = &amp;threadGlobalTimerHeap();
</span><span class="cx"> 
</span><span class="cx">     // Keep heap valid while changing the next-fire time.
</span><del>-    double oldTime = m_nextFireTime;
</del><ins>+    MonotonicTime oldTime = m_nextFireTime;
</ins><span class="cx">     // Don't realign zero-delay timers.
</span><span class="cx">     if (newTime) {
</span><del>-        if (auto newAlignedTime = alignedFireTime(Seconds { newTime }))
-            newTime = newAlignedTime.value().seconds();
</del><ins>+        if (auto newAlignedTime = alignedFireTime(newTime))
+            newTime = newAlignedTime.value();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (oldTime != newTime) {
</span><span class="lines">@@ -416,10 +410,10 @@
</span><span class="cx">     setNextFireTime(m_unalignedNextFireTime);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-double TimerBase::nextUnalignedFireInterval() const
</del><ins>+Seconds TimerBase::nextUnalignedFireInterval() const
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(isActive());
</span><del>-    return std::max(m_unalignedNextFireTime - monotonicallyIncreasingTime(), 0.0);
</del><ins>+    return std::max(m_unalignedNextFireTime - MonotonicTime::now(), 0_s);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformTimerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Timer.h (215135 => 215136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Timer.h        2017-04-08 01:15:09 UTC (rev 215135)
+++ trunk/Source/WebCore/platform/Timer.h        2017-04-08 01:33:55 UTC (rev 215136)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;chrono&gt;
</span><span class="cx"> #include &lt;functional&gt;
</span><ins>+#include &lt;wtf/MonotonicTime.h&gt;
</ins><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #include &lt;wtf/Optional.h&gt;
</span><span class="cx"> #include &lt;wtf/Seconds.h&gt;
</span><span class="lines">@@ -55,7 +56,8 @@
</span><span class="cx">     WEBCORE_EXPORT TimerBase();
</span><span class="cx">     WEBCORE_EXPORT virtual ~TimerBase();
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT void start(double nextFireInterval, double repeatInterval);
</del><ins>+    WEBCORE_EXPORT void start(Seconds nextFireInterval, Seconds repeatInterval);
+    WEBCORE_EXPORT void start(double nextFireInterval, double repeatInterval) { start(Seconds { nextFireInterval }, Seconds { repeatInterval }); }
</ins><span class="cx"> 
</span><span class="cx">     void startRepeating(double repeatInterval) { start(repeatInterval, repeatInterval); }
</span><span class="cx">     void startRepeating(std::chrono::milliseconds repeatInterval) { startRepeating(msToSeconds(repeatInterval)); }
</span><span class="lines">@@ -63,23 +65,24 @@
</span><span class="cx"> 
</span><span class="cx">     void startOneShot(double interval) { start(interval, 0); }
</span><span class="cx">     void startOneShot(std::chrono::milliseconds interval) { startOneShot(msToSeconds(interval)); }
</span><del>-    void startOneShot(Seconds interval) { start(interval.value(), 0); }
</del><ins>+    void startOneShot(Seconds interval) { start(interval, 0_s); }
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void stop();
</span><span class="cx">     bool isActive() const;
</span><span class="cx"> 
</span><del>-    double nextFireInterval() const;
-    double nextUnalignedFireInterval() const;
-    double repeatInterval() const { return m_repeatInterval; }
</del><ins>+    double nextFireInterval() const; // FIXME: Should return Seconds.
+    Seconds nextUnalignedFireInterval() const;
+    double repeatInterval() const { return m_repeatInterval.value(); } // FIXME: Should return Seconds.
+    Seconds repeatIntervalSeconds() const { return m_repeatInterval; } // FIXME: Remove once repeatInterval() returns Seconds.
</ins><span class="cx">     std::chrono::milliseconds repeatIntervalMS() const { return secondsToMS(repeatInterval()); }
</span><span class="cx"> 
</span><del>-    void augmentFireInterval(double delta) { setNextFireTime(m_nextFireTime + delta); }
</del><ins>+    void augmentFireInterval(Seconds delta) { setNextFireTime(m_nextFireTime + delta); }
</ins><span class="cx">     void augmentFireInterval(std::chrono::milliseconds delta) { augmentFireInterval(msToSeconds(delta)); }
</span><del>-    void augmentFireInterval(Seconds delta) { augmentFireInterval(delta.value()); }
</del><ins>+    void augmentFireInterval(double delta) { augmentFireInterval(Seconds { delta }); }
</ins><span class="cx"> 
</span><del>-    void augmentRepeatInterval(double delta) { augmentFireInterval(delta); m_repeatInterval += delta; }
</del><ins>+    void augmentRepeatInterval(Seconds delta) { augmentFireInterval(delta); m_repeatInterval += delta; }
</ins><span class="cx">     void augmentRepeatInterval(std::chrono::milliseconds delta) { augmentRepeatInterval(msToSeconds(delta)); }
</span><del>-    void augmentRepeatInterval(Seconds delta) { augmentRepeatInterval(delta.value()); }
</del><ins>+    void augmentRepeatInterval(double delta) { augmentRepeatInterval(Seconds { delta }); }
</ins><span class="cx"> 
</span><span class="cx">     void didChangeAlignmentInterval();
</span><span class="cx"> 
</span><span class="lines">@@ -88,17 +91,17 @@
</span><span class="cx"> private:
</span><span class="cx">     virtual void fired() = 0;
</span><span class="cx"> 
</span><del>-    virtual std::optional&lt;Seconds&gt; alignedFireTime(Seconds) const { return std::nullopt; }
</del><ins>+    virtual std::optional&lt;MonotonicTime&gt; alignedFireTime(MonotonicTime) const { return std::nullopt; }
</ins><span class="cx"> 
</span><span class="cx">     void checkConsistency() const;
</span><span class="cx">     void checkHeapIndex() const;
</span><span class="cx"> 
</span><del>-    void setNextFireTime(double);
</del><ins>+    void setNextFireTime(MonotonicTime);
</ins><span class="cx"> 
</span><span class="cx">     bool inHeap() const { return m_heapIndex != -1; }
</span><span class="cx"> 
</span><span class="cx">     bool hasValidHeapPosition() const;
</span><del>-    void updateHeapIfNeeded(double oldTime);
</del><ins>+    void updateHeapIfNeeded(MonotonicTime oldTime);
</ins><span class="cx"> 
</span><span class="cx">     void heapDecreaseKey();
</span><span class="cx">     void heapDelete();
</span><span class="lines">@@ -110,16 +113,16 @@
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;TimerBase*&gt;&amp; timerHeap() const { ASSERT(m_cachedThreadGlobalTimerHeap); return *m_cachedThreadGlobalTimerHeap; }
</span><span class="cx"> 
</span><del>-    double m_nextFireTime; // 0 if inactive
-    double m_unalignedNextFireTime; // m_nextFireTime not considering alignment interval
-    double m_repeatInterval; // 0 if not repeating
-    int m_heapIndex; // -1 if not in heap
</del><ins>+    MonotonicTime m_nextFireTime; // 0 if inactive
+    MonotonicTime m_unalignedNextFireTime; // m_nextFireTime not considering alignment interval
+    Seconds m_repeatInterval; // 0 if not repeating
+    int m_heapIndex { -1 }; // -1 if not in heap
</ins><span class="cx">     unsigned m_heapInsertionOrder; // Used to keep order among equal-fire-time timers
</span><del>-    Vector&lt;TimerBase*&gt;* m_cachedThreadGlobalTimerHeap;
</del><ins>+    Vector&lt;TimerBase*&gt;* m_cachedThreadGlobalTimerHeap { nullptr };
</ins><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx">     ThreadIdentifier m_thread;
</span><del>-    bool m_wasDeleted;
</del><ins>+    bool m_wasDeleted { false };
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     friend class ThreadTimers;
</span><span class="lines">@@ -159,7 +162,7 @@
</span><span class="cx"> #else
</span><span class="cx">     ASSERT(WebThreadIsCurrent() || pthread_main_np() || m_thread == currentThread());
</span><span class="cx"> #endif // PLATFORM(IOS)
</span><del>-    return m_nextFireTime;
</del><ins>+    return static_cast&lt;bool&gt;(m_nextFireTime);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> class DeferrableOneShotTimer : protected TimerBase {
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (215135 => 215136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2017-04-08 01:15:09 UTC (rev 215135)
+++ trunk/Source/WebCore/testing/Internals.cpp        2017-04-08 01:33:55 UTC (rev 215136)
</span><span class="lines">@@ -151,6 +151,7 @@
</span><span class="cx"> #include &lt;runtime/JSCInlines.h&gt;
</span><span class="cx"> #include &lt;runtime/JSCJSValue.h&gt;
</span><span class="cx"> #include &lt;wtf/MemoryPressureHandler.h&gt;
</span><ins>+#include &lt;wtf/MonotonicTime.h&gt;
</ins><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringBuffer.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringBuilder.h&gt;
</span><span class="lines">@@ -1081,7 +1082,7 @@
</span><span class="cx">     if (timer-&gt;intervalClampedToMinimum() &gt; timer-&gt;m_originalInterval)
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    return !!timer-&gt;alignedFireTime(0_s);
</del><ins>+    return !!timer-&gt;alignedFireTime(MonotonicTime { });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool Internals::isRequestAnimationFrameThrottled() const
</span></span></pre>
</div>
</div>

</body>
</html>