<!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>[193322] branches/safari-601-branch/Source/WebInspectorUI</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/193322">193322</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2015-12-03 11:10:33 -0800 (Thu, 03 Dec 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/192560">r192560</a>. rdar://problem/23221163</pre>
<h3>Modified Paths</h3>
<ul>
<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="#branchessafari601branchSourceWebInspectorUIUserInterfaceModelsTimelinejs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Models/Timeline.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceModelsTimelineRecordingjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsTimelineOverviewjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsTimelineRecordingContentViewjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601branchSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/ChangeLog (193321 => 193322)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/ChangeLog        2015-12-03 19:10:26 UTC (rev 193321)
+++ branches/safari-601-branch/Source/WebInspectorUI/ChangeLog        2015-12-03 19:10:33 UTC (rev 193322)
</span><span class="lines">@@ -1,5 +1,34 @@
</span><span class="cx"> 2015-12-03 Timothy Hatcher <timothy@apple.com>
</span><span class="cx">
</span><ins>+ Merge r192560. rdar://problem/23221163
+
+ 2015-11-17 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Move Timeline creation into a recording
+ https://bugs.webkit.org/show_bug.cgi?id=151367
+
+ Reviewed by Timothy Hatcher.
+
+ * UserInterface/Controllers/TimelineManager.js:
+ (WebInspector.TimelineManager.prototype._loadNewRecording): Deleted.
+ * UserInterface/Models/Timeline.js:
+ (WebInspector.Timeline.create):
+ (WebInspector.Timeline.prototype.get type):
+ (WebInspector.Timeline): Deleted.
+ (WebInspector.Timeline.prototype.get recording): Deleted.
+ * UserInterface/Models/TimelineRecording.js:
+ (WebInspector.TimelineRecording):
+ (WebInspector.TimelineRecording.prototype.get readonly):
+ (WebInspector.TimelineRecording.prototype.unloaded):
+ (WebInspector.TimelineRecording.prototype.reset):
+ (WebInspector.TimelineRecording.prototype.isWritable): Deleted.
+ * UserInterface/Views/TimelineOverview.js:
+ (WebInspector.TimelineOverview):
+ * UserInterface/Views/TimelineRecordingContentView.js:
+ (WebInspector.TimelineRecordingContentView.prototype.shown):
+
+2015-12-03 Timothy Hatcher <timothy@apple.com>
+
</ins><span class="cx"> Merge r192551. rdar://problem/23221163
</span><span class="cx">
</span><span class="cx"> 2015-11-17 Matt Baker <mattbaker@apple.com>
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceControllersTimelineManagerjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (193321 => 193322)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js        2015-12-03 19:10:26 UTC (rev 193321)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js        2015-12-03 19:10:33 UTC (rev 193322)
</span><span class="lines">@@ -447,19 +447,10 @@
</span><span class="cx">
</span><span class="cx"> var identifier = this._nextRecordingIdentifier++;
</span><span class="cx"> var newRecording = new WebInspector.TimelineRecording(identifier, WebInspector.UIString("Timeline Recording %d").format(identifier));
</span><del>- newRecording.addTimeline(WebInspector.Timeline.create(WebInspector.TimelineRecord.Type.Network, newRecording));
- newRecording.addTimeline(WebInspector.Timeline.create(WebInspector.TimelineRecord.Type.Layout, newRecording));
- newRecording.addTimeline(WebInspector.Timeline.create(WebInspector.TimelineRecord.Type.Script, newRecording));
</del><span class="cx">
</span><del>- // COMPATIBILITY (iOS 8): TimelineAgent.EventType.RenderingFrame did not exist.
- if (window.TimelineAgent && TimelineAgent.EventType.RenderingFrame)
- newRecording.addTimeline(WebInspector.Timeline.create(WebInspector.TimelineRecord.Type.RenderingFrame, newRecording));
-
</del><span class="cx"> this._recordings.push(newRecording);
</span><span class="cx"> this.dispatchEventToListeners(WebInspector.TimelineManager.Event.RecordingCreated, {recording: newRecording});
</span><span class="cx">
</span><del>- console.assert(newRecording.isWritable());
-
</del><span class="cx"> if (this._isCapturing)
</span><span class="cx"> this.stopCapturing();
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceModelsTimelinejs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Models/Timeline.js (193321 => 193322)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Models/Timeline.js        2015-12-03 19:10:26 UTC (rev 193321)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Models/Timeline.js        2015-12-03 19:10:33 UTC (rev 193322)
</span><span class="lines">@@ -25,28 +25,32 @@
</span><span class="cx">
</span><span class="cx"> WebInspector.Timeline = class Timeline extends WebInspector.Object
</span><span class="cx"> {
</span><del>- constructor(type, recording)
</del><ins>+ constructor(type)
</ins><span class="cx"> {
</span><span class="cx"> super();
</span><span class="cx">
</span><span class="cx"> this._type = type;
</span><del>- this._recording = recording;
</del><span class="cx">
</span><span class="cx"> this.reset(true);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Static
</span><span class="cx">
</span><del>- static create(type, recording)
</del><ins>+ static create(type)
</ins><span class="cx"> {
</span><span class="cx"> if (type === WebInspector.TimelineRecord.Type.Network)
</span><del>- return new WebInspector.NetworkTimeline(type, recording);
</del><ins>+ return new WebInspector.NetworkTimeline(type);
</ins><span class="cx">
</span><del>- return new WebInspector.Timeline(type, recording);
</del><ins>+ return new WebInspector.Timeline(type);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Public
</span><span class="cx">
</span><ins>+ get type()
+ {
+ return this._type;
+ }
+
</ins><span class="cx"> get startTime()
</span><span class="cx"> {
</span><span class="cx"> return this._startTime;
</span><span class="lines">@@ -62,16 +66,6 @@
</span><span class="cx"> return this._records;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- get type()
- {
- return this._type;
- }
-
- get recording()
- {
- return this._recording;
- }
-
</del><span class="cx"> get displayName()
</span><span class="cx"> {
</span><span class="cx"> if (this._type === WebInspector.TimelineRecord.Type.Network)
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceModelsTimelineRecordingjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js (193321 => 193322)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js        2015-12-03 19:10:26 UTC (rev 193321)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js        2015-12-03 19:10:33 UTC (rev 193322)
</span><span class="lines">@@ -32,8 +32,16 @@
</span><span class="cx"> this._identifier = identifier;
</span><span class="cx"> this._timelines = new Map;
</span><span class="cx"> this._displayName = displayName;
</span><del>- this._isWritable = true;
</del><ins>+ this._readonly = false;
</ins><span class="cx">
</span><ins>+ this.addTimeline(WebInspector.Timeline.create(WebInspector.TimelineRecord.Type.Network));
+ this.addTimeline(WebInspector.Timeline.create(WebInspector.TimelineRecord.Type.Layout));
+ this.addTimeline(WebInspector.Timeline.create(WebInspector.TimelineRecord.Type.Script));
+
+ // COMPATIBILITY (iOS 8): TimelineAgent.EventType.RenderingFrame did not exist.
+ if (window.TimelineAgent && TimelineAgent.EventType.RenderingFrame)
+ this.addTimeline(WebInspector.Timeline.create(WebInspector.TimelineRecord.Type.RenderingFrame));
+
</ins><span class="cx"> // For legacy backends, we compute the elapsed time of records relative to this timestamp.
</span><span class="cx"> this._legacyFirstRecordedTimestamp = NaN;
</span><span class="cx">
</span><span class="lines">@@ -57,6 +65,11 @@
</span><span class="cx"> return this._timelines;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ get readonly()
+ {
+ return this._readonly;
+ }
+
</ins><span class="cx"> get startTime()
</span><span class="cx"> {
</span><span class="cx"> return this._startTime;
</span><span class="lines">@@ -73,11 +86,6 @@
</span><span class="cx"> // re-opened, so do not attempt to restore by identifier or display name.
</span><span class="cx"> }
</span><span class="cx">
</span><del>- isWritable()
- {
- return this._isWritable;
- }
-
</del><span class="cx"> isEmpty()
</span><span class="cx"> {
</span><span class="cx"> for (var timeline of this._timelines.values()) {
</span><span class="lines">@@ -92,14 +100,14 @@
</span><span class="cx"> {
</span><span class="cx"> console.assert(!this.isEmpty(), "Shouldn't unload an empty recording; it should be reused instead.");
</span><span class="cx">
</span><del>- this._isWritable = false;
</del><ins>+ this._readonly = true;
</ins><span class="cx">
</span><span class="cx"> this.dispatchEventToListeners(WebInspector.TimelineRecording.Event.Unloaded);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> reset(suppressEvents)
</span><span class="cx"> {
</span><del>- console.assert(this._isWritable, "Can't reset a read-only recording.");
</del><ins>+ console.assert(!this._readonly, "Can't reset a read-only recording.");
</ins><span class="cx">
</span><span class="cx"> this._sourceCodeTimelinesMap = new Map;
</span><span class="cx"> this._eventMarkers = [];
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsTimelineOverviewjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js (193321 => 193322)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js        2015-12-03 19:10:26 UTC (rev 193321)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js        2015-12-03 19:10:33 UTC (rev 193322)
</span><span class="lines">@@ -29,6 +29,8 @@
</span><span class="cx"> {
</span><span class="cx"> super();
</span><span class="cx">
</span><ins>+ console.assert(timelineRecording instanceof WebInspector.TimelineRecording);
+
</ins><span class="cx"> this._recording = timelineRecording;
</span><span class="cx"> this._recording.addEventListener(WebInspector.TimelineRecording.Event.TimelineAdded, this._timelineAdded, this);
</span><span class="cx"> this._recording.addEventListener(WebInspector.TimelineRecording.Event.TimelineRemoved, this._timelineRemoved, this);
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsTimelineRecordingContentViewjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js (193321 => 193322)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js        2015-12-03 19:10:26 UTC (rev 193321)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js        2015-12-03 19:10:33 UTC (rev 193322)
</span><span class="lines">@@ -164,7 +164,7 @@
</span><span class="cx"> {
</span><span class="cx"> this._currentTimelineOverview.shown();
</span><span class="cx"> this._contentViewContainer.shown();
</span><del>- this._clearTimelineNavigationItem.enabled = this._recording.isWritable();
</del><ins>+ this._clearTimelineNavigationItem.enabled = !this._recording.readonly;
</ins><span class="cx">
</span><span class="cx"> this._currentContentViewDidChange();
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>