Web Inspector: XHR breakpoints shouldn't be cleared from the sidebar on reload
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Apr 2017 18:50:19 +0000 (18:50 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Apr 2017 18:50:19 +0000 (18:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=170930

Reviewed by Joseph Pecoraro.

XHR breakpoints aren't associated with the main resource, and shouldn't
be cleared from the manager or sidebar UI When the main resource changes.

* UserInterface/Controllers/DOMDebuggerManager.js:
(WebInspector.DOMDebuggerManager.prototype._mainResourceDidChange):
* UserInterface/Controllers/XHRBreakpointTreeController.js:
(WebInspector.XHRBreakpointTreeController):
(WebInspector.XHRBreakpointTreeController.prototype._mainResourceDidChange): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215473 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js
Source/WebInspectorUI/UserInterface/Controllers/XHRBreakpointTreeController.js

index 70979d7..12f3c22 100644 (file)
@@ -1,3 +1,19 @@
+2017-04-18  Matt Baker  <mattbaker@apple.com>
+
+        Web Inspector: XHR breakpoints shouldn't be cleared from the sidebar on reload
+        https://bugs.webkit.org/show_bug.cgi?id=170930
+
+        Reviewed by Joseph Pecoraro.
+
+        XHR breakpoints aren't associated with the main resource, and shouldn't
+        be cleared from the manager or sidebar UI When the main resource changes.
+
+        * UserInterface/Controllers/DOMDebuggerManager.js:
+        (WebInspector.DOMDebuggerManager.prototype._mainResourceDidChange):
+        * UserInterface/Controllers/XHRBreakpointTreeController.js:
+        (WebInspector.XHRBreakpointTreeController):
+        (WebInspector.XHRBreakpointTreeController.prototype._mainResourceDidChange): Deleted.
+
 2017-04-17  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: Network columns don't get saved when Web Inspector is closed
 2017-04-17  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: Network columns don't get saved when Web Inspector is closed
index ce9d181..8bfc536 100644 (file)
@@ -429,9 +429,6 @@ WebInspector.DOMDebuggerManager = class DOMDebuggerManager extends WebInspector.
                 breakpoints.forEach((breakpoint) => { breakpoint.domNodeIdentifier = null; });
 
             this._domBreakpointFrameIdentifierMap.clear();
                 breakpoints.forEach((breakpoint) => { breakpoint.domNodeIdentifier = null; });
 
             this._domBreakpointFrameIdentifierMap.clear();
-
-            for (let breakpoint of this._xhrBreakpoints)
-                this._detachXHRBreakpoint(breakpoint);
         } else
             this._detachBreakpointsForFrame(frame);
 
         } else
             this._detachBreakpointsForFrame(frame);
 
index 2d10e29..f8c8951 100644 (file)
@@ -31,8 +31,6 @@ WebInspector.XHRBreakpointTreeController = class XHRBreakpointsTreeController ex
 
         this._treeOutline = treeOutline;
 
 
         this._treeOutline = treeOutline;
 
-        WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
-
         WebInspector.domDebuggerManager.addEventListener(WebInspector.DOMDebuggerManager.Event.XHRBreakpointAdded, this._xhrBreakpointAdded, this);
         WebInspector.domDebuggerManager.addEventListener(WebInspector.DOMDebuggerManager.Event.XHRBreakpointRemoved, this._xhrBreakpointRemoved, this);
 
         WebInspector.domDebuggerManager.addEventListener(WebInspector.DOMDebuggerManager.Event.XHRBreakpointAdded, this._xhrBreakpointAdded, this);
         WebInspector.domDebuggerManager.addEventListener(WebInspector.DOMDebuggerManager.Event.XHRBreakpointRemoved, this._xhrBreakpointRemoved, this);
 
@@ -78,15 +76,6 @@ WebInspector.XHRBreakpointTreeController = class XHRBreakpointsTreeController ex
         this._treeOutline.removeChild(treeElement);
     }
 
         this._treeOutline.removeChild(treeElement);
     }
 
-    _mainResourceDidChange(event)
-    {
-        if (!event.target.isMainFrame())
-            return;
-
-        while (this._treeOutline.children.length > 1)
-            this._treeOutline.removeChild(this._treeOutline.children.lastValue);
-    }
-
     _addTreeElement(breakpoint)
     {
         let treeElement = this._treeOutline.findTreeElement(breakpoint);
     _addTreeElement(breakpoint)
     {
         let treeElement = this._treeOutline.findTreeElement(breakpoint);