<!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>[193017] branches/safari-601-branch</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/193017">193017</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2015-12-03 10:31:44 -0800 (Thu, 03 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/187211">r187211</a>. rdar://problem/23221163</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601branchLayoutTestsChangeLog">branches/safari-601-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceJavaScriptCoreChangeLog">branches/safari-601-branch/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceJavaScriptCoreinspectorprotocolTimelinejson">branches/safari-601-branch/Source/JavaScriptCore/inspector/protocol/Timeline.json</a></li>
<li><a href="#branchessafari601branchSourceWebCoreChangeLog">branches/safari-601-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceWebCoreinspectorInspectorTimelineAgentcpp">branches/safari-601-branch/Source/WebCore/inspector/InspectorTimelineAgent.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIChangeLog">branches/safari-601-branch/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceControllersTimelineManagerjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceProtocolTimelineObserverjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsTimelineRecordingContentViewjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari601branchLayoutTestsinspectortimelinerecordingstartstoptimestampsexpectedtxt">branches/safari-601-branch/LayoutTests/inspector/timeline/recording-start-stop-timestamps-expected.txt</a></li>
<li><a href="#branchessafari601branchLayoutTestsinspectortimelinerecordingstartstoptimestampshtml">branches/safari-601-branch/LayoutTests/inspector/timeline/recording-start-stop-timestamps.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/LayoutTests/ChangeLog (193016 => 193017)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/ChangeLog        2015-12-03 18:31:33 UTC (rev 193016)
+++ branches/safari-601-branch/LayoutTests/ChangeLog        2015-12-03 18:31:44 UTC (rev 193017)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-12-01  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
+        Merge r187211. rdar://problem/23221163
+
+    2015-07-22  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+            Web Inspector: Timeline should immediately start moving play head when starting a new recording
+            https://bugs.webkit.org/show_bug.cgi?id=147210
+
+            Reviewed by Timothy Hatcher.
+
+            * inspector/timeline/recording-start-stop-timestamps-expected.txt: Added.
+            * inspector/timeline/recording-start-stop-timestamps.html: Added.
+            Add a test for Timeline.recordingStarted and Timeline.recordingStopped events.
+
</ins><span class="cx"> 2015-10-30  Lucas Forschler  &lt;lforschler@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r188366
</span></span></pre></div>
<a id="branchessafari601branchLayoutTestsinspectortimelinerecordingstartstoptimestampsexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/inspector/timeline/recording-start-stop-timestamps-expected.txt (0 => 193017)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/inspector/timeline/recording-start-stop-timestamps-expected.txt                                (rev 0)
+++ branches/safari-601-branch/LayoutTests/inspector/timeline/recording-start-stop-timestamps-expected.txt        2015-12-03 18:31:44 UTC (rev 193017)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+Testing that timeline start and stop events have timestamps and are ordered reasonably.
+
+PASS: 1st CapturingStarted had startTime
+PASS: 1st CapturingStopped had endTime
+PASS: 1st CapturingStopped had endTime &gt; 1st CapturingStarted
+PASS: 2nd CapturingStarted had startTime &gt; 1st CapturingStarted
+PASS: 2nd CapturingStarted had startTime &gt; 1st CapturingStopped
+PASS: 2nd CapturingStopped had endTime &gt; 1st CapturingStopped
+PASS: 2nd CapturingStopped had endTime &gt; 2nd CapturingStarted
+
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestsinspectortimelinerecordingstartstoptimestampshtml"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/inspector/timeline/recording-start-stop-timestamps.html (0 => 193017)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/inspector/timeline/recording-start-stop-timestamps.html                                (rev 0)
+++ branches/safari-601-branch/LayoutTests/inspector/timeline/recording-start-stop-timestamps.html        2015-12-03 18:31:44 UTC (rev 193017)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test()
+{
+    var recordingStartTime = NaN;
+    var recordingEndTime = NaN;
+
+    function check(condition, message)
+    {
+        InspectorTest.log((condition ? &quot;PASS&quot; : &quot;FAIL&quot;) + &quot;: &quot; + message);
+    }
+
+    WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStarted, function(event) {
+        InspectorTest.assert(typeof event.data.startTime === &quot;number&quot;);
+        InspectorTest.assert(event.data.startTime &gt; 0);
+
+        if (isNaN(recordingStartTime)) {
+            InspectorTest.log(&quot;PASS: 1st CapturingStarted had startTime&quot;);
+        } else {
+            InspectorTest.assert(event.data.startTime &gt; recordingStartTime, &quot;FAIL: 2nd CapturingStarted should be &gt; 1st CapturingStarted&quot;);
+            InspectorTest.log(&quot;PASS: 2nd CapturingStarted had startTime &gt; 1st CapturingStarted&quot;);
+            InspectorTest.assert(event.data.startTime &gt; recordingEndTime, &quot;FAIL: 2nd CapturingStarted should be &gt; 1st CapturingStopped&quot;);
+            InspectorTest.log(&quot;PASS: 2nd CapturingStarted had startTime &gt; 1st CapturingStopped&quot;);
+        }
+
+        recordingStartTime = event.data.startTime;
+    });
+
+    WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStopped, function(event) {
+        InspectorTest.assert(typeof event.data.endTime === &quot;number&quot;);
+        InspectorTest.assert(event.data.endTime &gt; 0);
+
+        if (isNaN(recordingEndTime)) {
+            InspectorTest.log(&quot;PASS: 1st CapturingStopped had endTime&quot;);
+            InspectorTest.assert(event.data.endTime &gt; recordingStartTime, &quot;FAIL: 1st CapturingStopped should be &gt; 1st CapturingStarted&quot;);
+            InspectorTest.log(&quot;PASS: 1st CapturingStopped had endTime &gt; 1st CapturingStarted&quot;);
+        } else {
+            InspectorTest.assert(event.data.endTime &gt; recordingEndTime, &quot;FAIL: 2nd CapturingStopped should be &gt; 1st CapturingStopped&quot;);
+            InspectorTest.log(&quot;PASS: 2nd CapturingStopped had endTime &gt; 1st CapturingStopped&quot;);
+            InspectorTest.assert(event.data.endTime &gt; recordingStartTime, &quot;FAIL: 2nd CapturingStopped should be &gt; 2nd CapturingStarted&quot;);
+            InspectorTest.log(&quot;PASS: 2nd CapturingStopped had endTime &gt; 2nd CapturingStarted&quot;);
+            InspectorTest.completeTest();
+        }
+
+        recordingEndTime = event.data.endTime;
+    });
+
+    TimelineAgent.start()
+        .then(function() { return TimelineAgent.stop(); })
+        .then(function() { return TimelineAgent.start(); })
+        .then(function() { return TimelineAgent.stop(); });
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Testing that timeline start and stop events have timestamps and are ordered reasonably.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari601branchSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/JavaScriptCore/ChangeLog (193016 => 193017)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/JavaScriptCore/ChangeLog        2015-12-03 18:31:33 UTC (rev 193016)
+++ branches/safari-601-branch/Source/JavaScriptCore/ChangeLog        2015-12-03 18:31:44 UTC (rev 193017)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-12-01  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
+        Merge r187211. rdar://problem/23221163
+
+    2015-07-22  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+            Web Inspector: Timeline should immediately start moving play head when starting a new recording
+            https://bugs.webkit.org/show_bug.cgi?id=147210
+
+            Reviewed by Timothy Hatcher.
+
+            * inspector/protocol/Timeline.json:
+            Add timestamps to recordingStarted and recordingStopped events.
+
</ins><span class="cx"> 2015-10-27  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r191395. rdar://problem/22847057
</span></span></pre></div>
<a id="branchessafari601branchSourceJavaScriptCoreinspectorprotocolTimelinejson"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/JavaScriptCore/inspector/protocol/Timeline.json (193016 => 193017)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/JavaScriptCore/inspector/protocol/Timeline.json        2015-12-03 18:31:33 UTC (rev 193016)
+++ branches/safari-601-branch/Source/JavaScriptCore/inspector/protocol/Timeline.json        2015-12-03 18:31:44 UTC (rev 193017)
</span><span class="lines">@@ -110,10 +110,16 @@
</span><span class="cx">         },
</span><span class="cx">         {
</span><span class="cx">             &quot;name&quot;: &quot;recordingStarted&quot;,
</span><ins>+            &quot;parameters&quot;: [
+                { &quot;name&quot;: &quot;startTime&quot;, &quot;type&quot;: &quot;number&quot;, &quot;description&quot;: &quot;Start time of this new recording.&quot; }
+            ],
</ins><span class="cx">             &quot;description&quot;: &quot;Fired when recording has started.&quot;
</span><span class="cx">         },
</span><span class="cx">         {
</span><span class="cx">             &quot;name&quot;: &quot;recordingStopped&quot;,
</span><ins>+            &quot;parameters&quot;: [
+                { &quot;name&quot;: &quot;endTime&quot;, &quot;type&quot;: &quot;number&quot;, &quot;description&quot;: &quot;End time of this recording.&quot; }
+            ],
</ins><span class="cx">             &quot;description&quot;: &quot;Fired when recording has stopped.&quot;
</span><span class="cx">         }
</span><span class="cx">     ]
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/ChangeLog (193016 => 193017)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/ChangeLog        2015-12-03 18:31:33 UTC (rev 193016)
+++ branches/safari-601-branch/Source/WebCore/ChangeLog        2015-12-03 18:31:44 UTC (rev 193017)
</span><span class="lines">@@ -1,5 +1,23 @@
</span><span class="cx"> 2015-12-01  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r187211. rdar://problem/23221163
+
+    2015-07-22  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+            Web Inspector: Timeline should immediately start moving play head when starting a new recording
+            https://bugs.webkit.org/show_bug.cgi?id=147210
+
+            Reviewed by Timothy Hatcher.
+
+            Test: inspector/timeline/recording-start-stop-timestamps.html
+
+            * inspector/InspectorTimelineAgent.cpp:
+            (WebCore::InspectorTimelineAgent::internalStart):
+            (WebCore::InspectorTimelineAgent::internalStop):
+            Include the current timestamp when starting / stopping a recording.
+
+2015-12-01  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
</ins><span class="cx">         Merge r186724. rdar://problem/23221163
</span><span class="cx"> 
</span><span class="cx">     2015-07-11  Nikita Vasilyev  &lt;nvasilyev@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreinspectorInspectorTimelineAgentcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/inspector/InspectorTimelineAgent.cpp (193016 => 193017)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2015-12-03 18:31:33 UTC (rev 193016)
+++ branches/safari-601-branch/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2015-12-03 18:31:44 UTC (rev 193017)
</span><span class="lines">@@ -185,7 +185,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     if (m_frontendDispatcher)
</span><del>-        m_frontendDispatcher-&gt;recordingStarted();
</del><ins>+        m_frontendDispatcher-&gt;recordingStarted(timestamp());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorTimelineAgent::internalStop()
</span><span class="lines">@@ -214,7 +214,7 @@
</span><span class="cx">     m_startedComposite = false;
</span><span class="cx"> 
</span><span class="cx">     if (m_frontendDispatcher)
</span><del>-        m_frontendDispatcher-&gt;recordingStopped();
</del><ins>+        m_frontendDispatcher-&gt;recordingStopped(timestamp());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double InspectorTimelineAgent::timestamp()
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/ChangeLog (193016 => 193017)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/ChangeLog        2015-12-03 18:31:33 UTC (rev 193016)
+++ branches/safari-601-branch/Source/WebInspectorUI/ChangeLog        2015-12-03 18:31:44 UTC (rev 193017)
</span><span class="lines">@@ -1,5 +1,37 @@
</span><span class="cx"> 2015-12-01  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r187211. rdar://problem/23221163
+
+    2015-07-22  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+            Web Inspector: Timeline should immediately start moving play head when starting a new recording
+            https://bugs.webkit.org/show_bug.cgi?id=147210
+
+            Reviewed by Timothy Hatcher.
+
+            * UserInterface/Protocol/TimelineObserver.js:
+            (WebInspector.TimelineObserver.prototype.recordingStarted):
+            (WebInspector.TimelineObserver.prototype.recordingStopped):
+            Pass on the new timestamps.
+
+            * UserInterface/Controllers/TimelineManager.js:
+            (WebInspector.TimelineManager.prototype.capturingStarted):
+            (WebInspector.TimelineManager.prototype.capturingStopped):
+            Pass on the new timestamps in the events.
+
+            * UserInterface/Views/TimelineRecordingContentView.js:
+            (WebInspector.TimelineRecordingContentView.prototype._capturingStarted):
+            Pass on the new timestamp from the event as it can be used to update the currentTime.
+
+            (WebInspector.TimelineRecordingContentView.prototype._startUpdatingCurrentTime):
+            If provided a startTime we can use that as the new currentTime. Otherwise fallback
+            to determining a good currentTime from the next incoming record for legacy backends.
+
+            (WebInspector.TimelineRecordingContentView.prototype._recordingTimesUpdated):
+            Update the comment, as there is now a solution but this is required for legacy backends.
+
+2015-12-01  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
</ins><span class="cx">         Merge r187207. rdar://problem/23221163
</span><span class="cx"> 
</span><span class="cx">     2015-07-22  Matt Baker  &lt;mattbaker@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceControllersTimelineManagerjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (193016 => 193017)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js        2015-12-03 18:31:33 UTC (rev 193016)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js        2015-12-03 18:31:44 UTC (rev 193017)
</span><span class="lines">@@ -144,17 +144,17 @@
</span><span class="cx"> 
</span><span class="cx">     // Protected
</span><span class="cx"> 
</span><del>-    capturingStarted()
</del><ins>+    capturingStarted(startTime)
</ins><span class="cx">     {
</span><span class="cx">         if (this._isCapturing)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         this._isCapturing = true;
</span><span class="cx"> 
</span><del>-        this.dispatchEventToListeners(WebInspector.TimelineManager.Event.CapturingStarted);
</del><ins>+        this.dispatchEventToListeners(WebInspector.TimelineManager.Event.CapturingStarted, {startTime});
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    capturingStopped()
</del><ins>+    capturingStopped(endTime)
</ins><span class="cx">     {
</span><span class="cx">         if (!this._isCapturing)
</span><span class="cx">             return;
</span><span class="lines">@@ -173,7 +173,7 @@
</span><span class="cx">         this._isCapturingPageReload = false;
</span><span class="cx">         this._autoCapturingMainResource = null;
</span><span class="cx"> 
</span><del>-        this.dispatchEventToListeners(WebInspector.TimelineManager.Event.CapturingStopped);
</del><ins>+        this.dispatchEventToListeners(WebInspector.TimelineManager.Event.CapturingStopped, {endTime});
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     eventRecorded(recordPayload)
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceProtocolTimelineObserverjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js (193016 => 193017)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js        2015-12-03 18:31:33 UTC (rev 193016)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js        2015-12-03 18:31:44 UTC (rev 193017)
</span><span class="lines">@@ -32,13 +32,13 @@
</span><span class="cx">         WebInspector.timelineManager.eventRecorded(record);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    recordingStarted()
</del><ins>+    recordingStarted(startTime)
</ins><span class="cx">     {
</span><del>-        WebInspector.timelineManager.capturingStarted();
</del><ins>+        WebInspector.timelineManager.capturingStarted(startTime);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    recordingStopped()
</del><ins>+    recordingStopped(endTime)
</ins><span class="cx">     {
</span><del>-        WebInspector.timelineManager.capturingStopped();
</del><ins>+        WebInspector.timelineManager.capturingStopped(endTime);
</ins><span class="cx">     }
</span><span class="cx"> };
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsTimelineRecordingContentViewjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js (193016 => 193017)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js        2015-12-03 18:31:33 UTC (rev 193016)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js        2015-12-03 18:31:44 UTC (rev 193017)
</span><span class="lines">@@ -442,18 +442,24 @@
</span><span class="cx">             this.currentTimelineView.updateLayoutIfNeeded();
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _startUpdatingCurrentTime: function()
</del><ins>+    _startUpdatingCurrentTime: function(startTime)
</ins><span class="cx">     {
</span><span class="cx">         console.assert(!this._updating);
</span><span class="cx">         if (this._updating)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         if (!isNaN(this._currentTime)) {
</span><del>-            // We have a current time already, so we likely need to jump into the future to a better current time.
</del><span class="cx">             // This happens when you stop and later restart recording.
</span><del>-            console.assert(!this._waitingToResetCurrentTime);
-            this._waitingToResetCurrentTime = true;
-            this._recording.addEventListener(WebInspector.TimelineRecording.Event.TimesUpdated, this._recordingTimesUpdated, this);
</del><ins>+            if (typeof startTime === &quot;number&quot;)
+                this._currentTime = startTime;
+            else {
+                // COMPATIBILITY (iOS 9): Timeline.recordingStarted events did not include a timestamp.
+                // We likely need to jump into the future to a better current time which we can
+                // ascertained from a new incoming timeline record, so we wait for a Timeline to update.
+                console.assert(!this._waitingToResetCurrentTime);
+                this._waitingToResetCurrentTime = true;
+                this._recording.addEventListener(WebInspector.TimelineRecording.Event.TimesUpdated, this._recordingTimesUpdated, this);
+            }
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         this._updating = true;
</span><span class="lines">@@ -478,7 +484,7 @@
</span><span class="cx"> 
</span><span class="cx">     _capturingStarted: function(event)
</span><span class="cx">     {
</span><del>-        this._startUpdatingCurrentTime();
</del><ins>+        this._startUpdatingCurrentTime(event.data.startTime);
</ins><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     _capturingStopped: function(event)
</span><span class="lines">@@ -508,10 +514,9 @@
</span><span class="cx">         if (!this._waitingToResetCurrentTime)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><ins>+        // COMPATIBILITY (iOS 9): Timeline.recordingStarted events did not include a new startTime.
</ins><span class="cx">         // Make the current time be the start time of the last added record. This is the best way
</span><span class="cx">         // currently to jump to the right period of time after recording starts.
</span><del>-        // FIXME: If no activity is happening we can sit for a while until a record is added.
-        // We might want to have the backend send a &quot;start&quot; record to get current time moving.
</del><span class="cx"> 
</span><span class="cx">         for (var timeline of this._recording.timelines.values()) {
</span><span class="cx">             var lastRecord = timeline.records.lastValue;
</span></span></pre>
</div>
</div>

</body>
</html>