- Revision
- 244265
- Author
- [email protected]
- Date
- 2019-04-15 10:23:26 -0700 (Mon, 15 Apr 2019)
Log Message
Web Inspector: REGRESSION: Heap: snapshots taken manually don't appear in the list
https://bugs.webkit.org/show_bug.cgi?id=196900
<rdar://problem/49880278>
Reviewed by Timothy Hatcher.
* UserInterface/Views/HeapAllocationsTimelineView.js:
(WI.HeapAllocationsTimelineView):
(WI.HeapAllocationsTimelineView.prototype.layout):
(WI.HeapAllocationsTimelineView.prototype._importButtonNavigationItemClicked):
(WI.HeapAllocationsTimelineView.prototype._takeHeapSnapshotClicked):
Drive-by: only show heap snapshots for the selected range.
* UserInterface/Views/TimelineView.js:
* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView):
(WI.TimelineRecordingContentView.prototype._handleTimelineViewNeedsEntireSelectedRange): Added.
Drive-by: taking (or importing) a heap snapshot should select the entire range so that the
new record will appear in the list of heap snapshots.
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (244264 => 244265)
--- trunk/Source/WebInspectorUI/ChangeLog 2019-04-15 17:22:11 UTC (rev 244264)
+++ trunk/Source/WebInspectorUI/ChangeLog 2019-04-15 17:23:26 UTC (rev 244265)
@@ -1,5 +1,27 @@
2019-04-15 Devin Rousso <[email protected]>
+ Web Inspector: REGRESSION: Heap: snapshots taken manually don't appear in the list
+ https://bugs.webkit.org/show_bug.cgi?id=196900
+ <rdar://problem/49880278>
+
+ Reviewed by Timothy Hatcher.
+
+ * UserInterface/Views/HeapAllocationsTimelineView.js:
+ (WI.HeapAllocationsTimelineView):
+ (WI.HeapAllocationsTimelineView.prototype.layout):
+ (WI.HeapAllocationsTimelineView.prototype._importButtonNavigationItemClicked):
+ (WI.HeapAllocationsTimelineView.prototype._takeHeapSnapshotClicked):
+ Drive-by: only show heap snapshots for the selected range.
+
+ * UserInterface/Views/TimelineView.js:
+ * UserInterface/Views/TimelineRecordingContentView.js:
+ (WI.TimelineRecordingContentView):
+ (WI.TimelineRecordingContentView.prototype._handleTimelineViewNeedsEntireSelectedRange): Added.
+ Drive-by: taking (or importing) a heap snapshot should select the entire range so that the
+ new record will appear in the list of heap snapshots.
+
+2019-04-15 Devin Rousso <[email protected]>
+
Web Inspector: REGRESSION (r244157): Timelines: ruler size appears wrong on first layout
https://bugs.webkit.org/show_bug.cgi?id=196901
<rdar://problem/49880539>
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js (244264 => 244265)
--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js 2019-04-15 17:22:11 UTC (rev 244264)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js 2019-04-15 17:23:26 UTC (rev 244265)
@@ -93,7 +93,7 @@
this._dataGrid.sortOrder = WI.DataGrid.SortOrder.Ascending;
this._dataGrid.createSettings("heap-allocations-timeline-view");
this._dataGrid.addEventListener(WI.DataGrid.Event.SelectedNodeChanged, this._dataGridNodeSelected, this);
-
+ this.setupDataGrid(this._dataGrid);
this.addSubview(this._dataGrid);
this._contentViewContainer = new WI.ContentViewContainer;
@@ -262,17 +262,20 @@
layout()
{
- if (this._pendingRecords.length && this.zeroTime) {
- for (let heapAllocationsTimelineRecord of this._pendingRecords) {
- this._dataGrid.addRowInSortOrder(new WI.HeapAllocationsTimelineDataGridNode(heapAllocationsTimelineRecord, {
- graphDataSource: this,
- heapAllocationsView: this,
- }));
- }
+ super.layout();
- this._pendingRecords = [];
- this._updateCompareHeapSnapshotButton();
+ if (!this._pendingRecords.length)
+ return;
+
+ for (let heapAllocationsTimelineRecord of this._pendingRecords) {
+ this._dataGrid.addRowInSortOrder(new WI.HeapAllocationsTimelineDataGridNode(heapAllocationsTimelineRecord, {
+ graphDataSource: this,
+ heapAllocationsView: this,
+ }));
}
+
+ this._pendingRecords = [];
+ this._updateCompareHeapSnapshotButton();
}
reset()
@@ -380,7 +383,7 @@
_importButtonNavigationItemClicked()
{
- WI.FileUtilities.importText(function(result) {
+ WI.FileUtilities.importText((result) => {
let snapshotStringData = result.text;
let workerProxy = WI.HeapSnapshotWorkerProxy.singleton();
workerProxy.createImportedSnapshot(snapshotStringData, result.filename, ({objectId, snapshot: serializedSnapshot}) => {
@@ -388,6 +391,7 @@
snapshot.snapshotStringData = snapshotStringData;
const timestamp = NaN;
WI.timelineManager.heapSnapshotAdded(timestamp, snapshot);
+ this.dispatchEventToListeners(WI.TimelineView.Event.NeedsEntireSelectedRange);
});
});
}
@@ -394,12 +398,13 @@
_takeHeapSnapshotClicked()
{
- HeapAgent.snapshot(function(error, timestamp, snapshotStringData) {
+ HeapAgent.snapshot((error, timestamp, snapshotStringData) => {
let workerProxy = WI.HeapSnapshotWorkerProxy.singleton();
workerProxy.createSnapshot(snapshotStringData, ({objectId, snapshot: serializedSnapshot}) => {
let snapshot = WI.HeapSnapshotProxy.deserialize(objectId, serializedSnapshot);
snapshot.snapshotStringData = snapshotStringData;
WI.timelineManager.heapSnapshotAdded(timestamp, snapshot);
+ this.dispatchEventToListeners(WI.TimelineView.Event.NeedsEntireSelectedRange);
});
});
}
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js (244264 => 244265)
--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js 2019-04-15 17:22:11 UTC (rev 244264)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js 2019-04-15 17:23:26 UTC (rev 244265)
@@ -114,6 +114,7 @@
WI.TimelineView.addEventListener(WI.TimelineView.Event.RecordWasSelected, this._handleTimelineViewRecordSelected, this);
WI.TimelineView.addEventListener(WI.TimelineView.Event.ScannerShow, this._handleTimelineViewScannerShow, this);
WI.TimelineView.addEventListener(WI.TimelineView.Event.ScannerHide, this._handleTimelineViewScannerHide, this);
+ WI.TimelineView.addEventListener(WI.TimelineView.Event.NeedsEntireSelectedRange, this._handleTimelineViewNeedsEntireSelectedRange, this);
WI.notifications.addEventListener(WI.Notification.VisibilityStateDidChange, this._inspectorVisibilityStateChanged, this);
@@ -933,6 +934,14 @@
this._timelineOverview.hideScanner();
}
+ _handleTimelineViewNeedsEntireSelectedRange(event)
+ {
+ if (!this.visible)
+ return;
+
+ this._timelineOverview.timelineRuler.selectEntireRange();
+ }
+
_updateProgressView()
{
let isCapturing = WI.timelineManager.isCapturing();
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js (244264 => 244265)
--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js 2019-04-15 17:22:11 UTC (rev 244264)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js 2019-04-15 17:23:26 UTC (rev 244265)
@@ -345,4 +345,5 @@
RecordWasSelected: "timeline-view-record-was-selected",
ScannerShow: "timeline-view-scanner-show",
ScannerHide: "timeline-view-scanner-hide",
+ NeedsEntireSelectedRange: "timeline-view-needs-entire-selected-range",
};