<!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>[193438] branches/safari-601.1.46-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/193438">193438</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2015-12-04 12:51:12 -0800 (Fri, 04 Dec 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/187211">r187211</a>. rdar://problem/23581597</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601146branchLayoutTestsChangeLog">branches/safari-601.1.46-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari601146branchSourceJavaScriptCoreChangeLog">branches/safari-601.1.46-branch/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#branchessafari601146branchSourceJavaScriptCoreinspectorprotocolTimelinejson">branches/safari-601.1.46-branch/Source/JavaScriptCore/inspector/protocol/Timeline.json</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreChangeLog">branches/safari-601.1.46-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreinspectorInspectorTimelineAgentcpp">branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorTimelineAgent.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebInspectorUIChangeLog">branches/safari-601.1.46-branch/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#branchessafari601146branchSourceWebInspectorUIUserInterfaceControllersTimelineManagerjs">branches/safari-601.1.46-branch/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js</a></li>
<li><a href="#branchessafari601146branchSourceWebInspectorUIUserInterfaceProtocolTimelineObserverjs">branches/safari-601.1.46-branch/Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js</a></li>
<li><a href="#branchessafari601146branchSourceWebInspectorUIUserInterfaceViewsTimelineRecordingContentViewjs">branches/safari-601.1.46-branch/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari601146branchLayoutTestsinspectortimelinerecordingstartstoptimestampsexpectedtxt">branches/safari-601.1.46-branch/LayoutTests/inspector/timeline/recording-start-stop-timestamps-expected.txt</a></li>
<li><a href="#branchessafari601146branchLayoutTestsinspectortimelinerecordingstartstoptimestampshtml">branches/safari-601.1.46-branch/LayoutTests/inspector/timeline/recording-start-stop-timestamps.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601146branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/ChangeLog (193437 => 193438)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/ChangeLog        2015-12-04 20:32:21 UTC (rev 193437)
+++ branches/safari-601.1.46-branch/LayoutTests/ChangeLog        2015-12-04 20:51:12 UTC (rev 193438)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-12-04 Timothy Hatcher <timothy@apple.com>
+
+ Merge r187211. rdar://problem/23581597
+
+ 2015-07-22 Joseph Pecoraro <pecoraro@apple.com>
+
+ 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-12-01 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r192432. rdar://problem/23558672
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestsinspectortimelinerecordingstartstoptimestampsexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-601.1.46-branch/LayoutTests/inspector/timeline/recording-start-stop-timestamps-expected.txt (0 => 193438)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/inspector/timeline/recording-start-stop-timestamps-expected.txt         (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/inspector/timeline/recording-start-stop-timestamps-expected.txt        2015-12-04 20:51:12 UTC (rev 193438)
</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 > 1st CapturingStarted
+PASS: 2nd CapturingStarted had startTime > 1st CapturingStarted
+PASS: 2nd CapturingStarted had startTime > 1st CapturingStopped
+PASS: 2nd CapturingStopped had endTime > 1st CapturingStopped
+PASS: 2nd CapturingStopped had endTime > 2nd CapturingStarted
+
</ins></span></pre></div>
<a id="branchessafari601146branchLayoutTestsinspectortimelinerecordingstartstoptimestampshtml"></a>
<div class="addfile"><h4>Added: branches/safari-601.1.46-branch/LayoutTests/inspector/timeline/recording-start-stop-timestamps.html (0 => 193438)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/inspector/timeline/recording-start-stop-timestamps.html         (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/inspector/timeline/recording-start-stop-timestamps.html        2015-12-04 20:51:12 UTC (rev 193438)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+<!doctype html>
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script>
+function test()
+{
+ var recordingStartTime = NaN;
+ var recordingEndTime = NaN;
+
+ function check(condition, message)
+ {
+ InspectorTest.log((condition ? "PASS" : "FAIL") + ": " + message);
+ }
+
+ WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStarted, function(event) {
+ InspectorTest.assert(typeof event.data.startTime === "number");
+ InspectorTest.assert(event.data.startTime > 0);
+
+ if (isNaN(recordingStartTime)) {
+ InspectorTest.log("PASS: 1st CapturingStarted had startTime");
+ } else {
+ InspectorTest.assert(event.data.startTime > recordingStartTime, "FAIL: 2nd CapturingStarted should be > 1st CapturingStarted");
+ InspectorTest.log("PASS: 2nd CapturingStarted had startTime > 1st CapturingStarted");
+ InspectorTest.assert(event.data.startTime > recordingEndTime, "FAIL: 2nd CapturingStarted should be > 1st CapturingStopped");
+ InspectorTest.log("PASS: 2nd CapturingStarted had startTime > 1st CapturingStopped");
+ }
+
+ recordingStartTime = event.data.startTime;
+ });
+
+ WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStopped, function(event) {
+ InspectorTest.assert(typeof event.data.endTime === "number");
+ InspectorTest.assert(event.data.endTime > 0);
+
+ if (isNaN(recordingEndTime)) {
+ InspectorTest.log("PASS: 1st CapturingStopped had endTime");
+ InspectorTest.assert(event.data.endTime > recordingStartTime, "FAIL: 1st CapturingStopped should be > 1st CapturingStarted");
+ InspectorTest.log("PASS: 1st CapturingStopped had endTime > 1st CapturingStarted");
+ } else {
+ InspectorTest.assert(event.data.endTime > recordingEndTime, "FAIL: 2nd CapturingStopped should be > 1st CapturingStopped");
+ InspectorTest.log("PASS: 2nd CapturingStopped had endTime > 1st CapturingStopped");
+ InspectorTest.assert(event.data.endTime > recordingStartTime, "FAIL: 2nd CapturingStopped should be > 2nd CapturingStarted");
+ InspectorTest.log("PASS: 2nd CapturingStopped had endTime > 2nd CapturingStarted");
+ InspectorTest.completeTest();
+ }
+
+ recordingEndTime = event.data.endTime;
+ });
+
+ TimelineAgent.start()
+ .then(function() { return TimelineAgent.stop(); })
+ .then(function() { return TimelineAgent.start(); })
+ .then(function() { return TimelineAgent.stop(); });
+}
+</script>
+</head>
+<body onload="runTest()">
+ <p>Testing that timeline start and stop events have timestamps and are ordered reasonably.</p>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari601146branchSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/JavaScriptCore/ChangeLog (193437 => 193438)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/JavaScriptCore/ChangeLog        2015-12-04 20:32:21 UTC (rev 193437)
+++ branches/safari-601.1.46-branch/Source/JavaScriptCore/ChangeLog        2015-12-04 20:51:12 UTC (rev 193438)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-12-04 Timothy Hatcher <timothy@apple.com>
+
+ Merge r187211. rdar://problem/23581597
+
+ 2015-07-22 Joseph Pecoraro <pecoraro@apple.com>
+
+ 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-11-13 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r188530. rdar://problem/23432371
</span></span></pre></div>
<a id="branchessafari601146branchSourceJavaScriptCoreinspectorprotocolTimelinejson"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/JavaScriptCore/inspector/protocol/Timeline.json (193437 => 193438)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/JavaScriptCore/inspector/protocol/Timeline.json        2015-12-04 20:32:21 UTC (rev 193437)
+++ branches/safari-601.1.46-branch/Source/JavaScriptCore/inspector/protocol/Timeline.json        2015-12-04 20:51:12 UTC (rev 193438)
</span><span class="lines">@@ -110,10 +110,16 @@
</span><span class="cx"> },
</span><span class="cx"> {
</span><span class="cx"> "name": "recordingStarted",
</span><ins>+ "parameters": [
+ { "name": "startTime", "type": "number", "description": "Start time of this new recording." }
+ ],
</ins><span class="cx"> "description": "Fired when recording has started."
</span><span class="cx"> },
</span><span class="cx"> {
</span><span class="cx"> "name": "recordingStopped",
</span><ins>+ "parameters": [
+ { "name": "endTime", "type": "number", "description": "End time of this recording." }
+ ],
</ins><span class="cx"> "description": "Fired when recording has stopped."
</span><span class="cx"> }
</span><span class="cx"> ]
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (193437 => 193438)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog        2015-12-04 20:32:21 UTC (rev 193437)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog        2015-12-04 20:51:12 UTC (rev 193438)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-12-04 Timothy Hatcher <timothy@apple.com>
+
+ Merge r187211. rdar://problem/23581597
+
+ 2015-07-22 Joseph Pecoraro <pecoraro@apple.com>
+
+ 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.
+
</ins><span class="cx"> 2015-12-02 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r192971. rdar://problem/23726466
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreinspectorInspectorTimelineAgentcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorTimelineAgent.cpp (193437 => 193438)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2015-12-04 20:32:21 UTC (rev 193437)
+++ branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2015-12-04 20:51:12 UTC (rev 193438)
</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->recordingStarted();
</del><ins>+ m_frontendDispatcher->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->recordingStopped();
</del><ins>+ m_frontendDispatcher->recordingStopped(timestamp());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> double InspectorTimelineAgent::timestamp()
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebInspectorUI/ChangeLog (193437 => 193438)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebInspectorUI/ChangeLog        2015-12-04 20:32:21 UTC (rev 193437)
+++ branches/safari-601.1.46-branch/Source/WebInspectorUI/ChangeLog        2015-12-04 20:51:12 UTC (rev 193438)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2015-12-04 Timothy Hatcher <timothy@apple.com>
+
+ Merge r187211. rdar://problem/23581597
+
+ 2015-07-22 Joseph Pecoraro <pecoraro@apple.com>
+
+ 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.
+
</ins><span class="cx"> 2015-11-13 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r188530. rdar://problem/23432371
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebInspectorUIUserInterfaceControllersTimelineManagerjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (193437 => 193438)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js        2015-12-04 20:32:21 UTC (rev 193437)
+++ branches/safari-601.1.46-branch/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js        2015-12-04 20:51:12 UTC (rev 193438)
</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="branchessafari601146branchSourceWebInspectorUIUserInterfaceProtocolTimelineObserverjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js (193437 => 193438)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js        2015-12-04 20:32:21 UTC (rev 193437)
+++ branches/safari-601.1.46-branch/Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js        2015-12-04 20:51:12 UTC (rev 193438)
</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="branchessafari601146branchSourceWebInspectorUIUserInterfaceViewsTimelineRecordingContentViewjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js (193437 => 193438)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js        2015-12-04 20:32:21 UTC (rev 193437)
+++ branches/safari-601.1.46-branch/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js        2015-12-04 20:51:12 UTC (rev 193438)
</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 === "number")
+ 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 "start" 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>