Title: [200805] trunk/Source/WebInspectorUI
Revision
200805
Author
[email protected]
Date
2016-05-12 17:55:57 -0700 (Thu, 12 May 2016)

Log Message

Web Inspector: Uncaught exception when removing selected Timeline instrument
https://bugs.webkit.org/show_bug.cgi?id=157639
<rdar://problem/26252938>

Reviewed by Timothy Hatcher.

* UserInterface/Views/TimelineOverview.js:
(WebInspector.TimelineOverview.prototype._instrumentRemoved):
Remove timeline tree element before modifying state. Removing the tree
element triggers a SelectionDidChange event, which can have side effects.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (200804 => 200805)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-05-13 00:48:00 UTC (rev 200804)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-05-13 00:55:57 UTC (rev 200805)
@@ -1,3 +1,16 @@
+2016-05-12  Matt Baker  <[email protected]>
+
+        Web Inspector: Uncaught exception when removing selected Timeline instrument
+        https://bugs.webkit.org/show_bug.cgi?id=157639
+        <rdar://problem/26252938>
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/TimelineOverview.js:
+        (WebInspector.TimelineOverview.prototype._instrumentRemoved):
+        Remove timeline tree element before modifying state. Removing the tree
+        element triggers a SelectionDidChange event, which can have side effects.
+
 2016-05-12  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Timeline Reset button only resets the one active Script TimelineView

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js (200804 => 200805)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js	2016-05-13 00:48:00 UTC (rev 200804)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js	2016-05-13 00:55:57 UTC (rev 200805)
@@ -634,16 +634,19 @@
         console.assert(instrument instanceof WebInspector.Instrument, instrument);
 
         let timeline = this._recording.timelineForInstrument(instrument);
-        console.assert(this._overviewGraphsByTypeMap.has(timeline.type), timeline);
+        let overviewGraph = this._overviewGraphsByTypeMap.get(timeline.type);
+        console.assert(overviewGraph, "Missing overview graph for timeline type", timeline.type);
 
-        let overviewGraph = this._overviewGraphsByTypeMap.take(timeline.type);
+        let treeElement = this._treeElementsByTypeMap.get(timeline.type);
+        let shouldSuppressOnDeselect = false;
+        let shouldSuppressSelectSibling = true;
+        this._timelinesTreeOutline.removeChild(treeElement, shouldSuppressOnDeselect, shouldSuppressSelectSibling);
+
         overviewGraph.removeEventListener(WebInspector.TimelineOverviewGraph.Event.RecordSelected, this._recordSelected, this);
         this._graphsContainerView.removeSubview(overviewGraph);
 
-        let treeElement = this._treeElementsByTypeMap.take(timeline.type);
-        let shouldSuppressOnDeselect = false;
-        let shouldSuppressSelectSibling = true;
-        this._timelinesTreeOutline.removeChild(treeElement, shouldSuppressOnDeselect, shouldSuppressSelectSibling);
+        this._overviewGraphsByTypeMap.delete(timeline.type);
+        this._treeElementsByTypeMap.delete(timeline.type);
     }
 
     _markerAdded(event)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to