⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 244265 in webkit


Ignore:
Timestamp:
Apr 15, 2019, 10:23:26 AM (7 years ago)
Author:
Devin Rousso
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.

Location:
trunk/Source/WebInspectorUI
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r244264 r244265  
     12019-04-15  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: REGRESSION: Heap: snapshots taken manually don't appear in the list
     4        https://bugs.webkit.org/show_bug.cgi?id=196900
     5        <rdar://problem/49880278>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        * UserInterface/Views/HeapAllocationsTimelineView.js:
     10        (WI.HeapAllocationsTimelineView):
     11        (WI.HeapAllocationsTimelineView.prototype.layout):
     12        (WI.HeapAllocationsTimelineView.prototype._importButtonNavigationItemClicked):
     13        (WI.HeapAllocationsTimelineView.prototype._takeHeapSnapshotClicked):
     14        Drive-by: only show heap snapshots for the selected range.
     15
     16        * UserInterface/Views/TimelineView.js:
     17        * UserInterface/Views/TimelineRecordingContentView.js:
     18        (WI.TimelineRecordingContentView):
     19        (WI.TimelineRecordingContentView.prototype._handleTimelineViewNeedsEntireSelectedRange): Added.
     20        Drive-by: taking (or importing) a heap snapshot should select the entire range so that the
     21        new record will appear in the list of heap snapshots.
     22
    1232019-04-15  Devin Rousso  <drousso@apple.com>
    224
  • trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js

    r243213 r244265  
    9494        this._dataGrid.createSettings("heap-allocations-timeline-view");
    9595        this._dataGrid.addEventListener(WI.DataGrid.Event.SelectedNodeChanged, this._dataGridNodeSelected, this);
    96 
     96        this.setupDataGrid(this._dataGrid);
    9797        this.addSubview(this._dataGrid);
    9898
     
    263263    layout()
    264264    {
    265         if (this._pendingRecords.length && this.zeroTime) {
    266             for (let heapAllocationsTimelineRecord of this._pendingRecords) {
    267                 this._dataGrid.addRowInSortOrder(new WI.HeapAllocationsTimelineDataGridNode(heapAllocationsTimelineRecord, {
    268                     graphDataSource: this,
    269                     heapAllocationsView: this,
    270                 }));
    271             }
    272 
    273             this._pendingRecords = [];
    274             this._updateCompareHeapSnapshotButton();
    275         }
     265        super.layout();
     266
     267        if (!this._pendingRecords.length)
     268            return;
     269
     270        for (let heapAllocationsTimelineRecord of this._pendingRecords) {
     271            this._dataGrid.addRowInSortOrder(new WI.HeapAllocationsTimelineDataGridNode(heapAllocationsTimelineRecord, {
     272                graphDataSource: this,
     273                heapAllocationsView: this,
     274            }));
     275        }
     276
     277        this._pendingRecords = [];
     278        this._updateCompareHeapSnapshotButton();
    276279    }
    277280
     
    381384    _importButtonNavigationItemClicked()
    382385    {
    383         WI.FileUtilities.importText(function(result) {
     386        WI.FileUtilities.importText((result) => {
    384387            let snapshotStringData = result.text;
    385388            let workerProxy = WI.HeapSnapshotWorkerProxy.singleton();
     
    389392                const timestamp = NaN;
    390393                WI.timelineManager.heapSnapshotAdded(timestamp, snapshot);
     394                this.dispatchEventToListeners(WI.TimelineView.Event.NeedsEntireSelectedRange);
    391395            });
    392396        });
     
    395399    _takeHeapSnapshotClicked()
    396400    {
    397         HeapAgent.snapshot(function(error, timestamp, snapshotStringData) {
     401        HeapAgent.snapshot((error, timestamp, snapshotStringData) => {
    398402            let workerProxy = WI.HeapSnapshotWorkerProxy.singleton();
    399403            workerProxy.createSnapshot(snapshotStringData, ({objectId, snapshot: serializedSnapshot}) => {
     
    401405                snapshot.snapshotStringData = snapshotStringData;
    402406                WI.timelineManager.heapSnapshotAdded(timestamp, snapshot);
     407                this.dispatchEventToListeners(WI.TimelineView.Event.NeedsEntireSelectedRange);
    403408            });
    404409        });
  • trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js

    r244195 r244265  
    115115        WI.TimelineView.addEventListener(WI.TimelineView.Event.ScannerShow, this._handleTimelineViewScannerShow, this);
    116116        WI.TimelineView.addEventListener(WI.TimelineView.Event.ScannerHide, this._handleTimelineViewScannerHide, this);
     117        WI.TimelineView.addEventListener(WI.TimelineView.Event.NeedsEntireSelectedRange, this._handleTimelineViewNeedsEntireSelectedRange, this);
    117118
    118119        WI.notifications.addEventListener(WI.Notification.VisibilityStateDidChange, this._inspectorVisibilityStateChanged, this);
     
    934935    }
    935936
     937    _handleTimelineViewNeedsEntireSelectedRange(event)
     938    {
     939        if (!this.visible)
     940            return;
     941
     942        this._timelineOverview.timelineRuler.selectEntireRange();
     943    }
     944
    936945    _updateProgressView()
    937946    {
  • trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js

    r243024 r244265  
    346346    ScannerShow: "timeline-view-scanner-show",
    347347    ScannerHide: "timeline-view-scanner-hide",
     348    NeedsEntireSelectedRange: "timeline-view-needs-entire-selected-range",
    348349};
Note: See TracChangeset for help on using the changeset viewer.