Title: [201099] trunk/Source/WebInspectorUI
Revision
201099
Author
bb...@apple.com
Date
2016-05-18 14:04:27 -0700 (Wed, 18 May 2016)

Log Message

Web Inspector: DebuggerSidebarPanel doesn't need to help manage temporarily disabling breakpoints while capturing
https://bugs.webkit.org/show_bug.cgi?id=157854

Reviewed by Timothy Hatcher.

Duplicate the event listeners in DebuggerManager and move non-view-related
state updates out of DebuggerSidebarPanel's listeners into DebuggerManager's listeners.
This allows a test to exercise the temporary-disablement code paths during capturing.

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.prototype.get breakpointsDisabledTemporarily):
Use this to make the code a bit more readable.

(WebInspector.DebuggerManager.prototype._startDisablingBreakpointsTemporarily):
(WebInspector.DebuggerManager.prototype._stopDisablingBreakpointsTemporarily):
(WebInspector.DebuggerManager.prototype.startDisablingBreakpointsTemporarily): Deleted.
(WebInspector.DebuggerManager.prototype.stopDisablingBreakpointsTemporarily): Deleted.
Make this private since it's not used by other classes anymore.

(WebInspector.DebuggerManager.prototype._timelineCapturingWillStart): Added.
(WebInspector.DebuggerManager.prototype._timelineCapturingStopped): Added.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype._timelineRecordingWillStart): Deleted.
(WebInspector.DebuggerSidebarPanel.prototype._timelineRecordingStopped): Deleted.
(WebInspector.DebuggerSidebarPanel.prototype._timelineCapturingWillStart): Added.
(WebInspector.DebuggerSidebarPanel.prototype._timelineCapturingStopped): Added.
Make the listener names consistent with TimelineManager: timelineCapturing{WillStart,Stopped}.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (201098 => 201099)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-05-18 20:42:20 UTC (rev 201098)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-05-18 21:04:27 UTC (rev 201099)
@@ -1,3 +1,34 @@
+2016-05-18  Brian Burg  <bb...@apple.com>
+
+        Web Inspector: DebuggerSidebarPanel doesn't need to help manage temporarily disabling breakpoints while capturing
+        https://bugs.webkit.org/show_bug.cgi?id=157854
+
+        Reviewed by Timothy Hatcher.
+
+        Duplicate the event listeners in DebuggerManager and move non-view-related
+        state updates out of DebuggerSidebarPanel's listeners into DebuggerManager's listeners.
+        This allows a test to exercise the temporary-disablement code paths during capturing.
+
+        * UserInterface/Controllers/DebuggerManager.js:
+        (WebInspector.DebuggerManager.prototype.get breakpointsDisabledTemporarily):
+        Use this to make the code a bit more readable.
+
+        (WebInspector.DebuggerManager.prototype._startDisablingBreakpointsTemporarily):
+        (WebInspector.DebuggerManager.prototype._stopDisablingBreakpointsTemporarily):
+        (WebInspector.DebuggerManager.prototype.startDisablingBreakpointsTemporarily): Deleted.
+        (WebInspector.DebuggerManager.prototype.stopDisablingBreakpointsTemporarily): Deleted.
+        Make this private since it's not used by other classes anymore.
+
+        (WebInspector.DebuggerManager.prototype._timelineCapturingWillStart): Added.
+        (WebInspector.DebuggerManager.prototype._timelineCapturingStopped): Added.
+
+        * UserInterface/Views/DebuggerSidebarPanel.js:
+        (WebInspector.DebuggerSidebarPanel.prototype._timelineRecordingWillStart): Deleted.
+        (WebInspector.DebuggerSidebarPanel.prototype._timelineRecordingStopped): Deleted.
+        (WebInspector.DebuggerSidebarPanel.prototype._timelineCapturingWillStart): Added.
+        (WebInspector.DebuggerSidebarPanel.prototype._timelineCapturingStopped): Added.
+        Make the listener names consistent with TimelineManager: timelineCapturing{WillStart,Stopped}.
+
 2016-05-18  Joseph Pecoraro  <pecor...@apple.com>
 
         Web Inspector: Improve console.takeHeapSnapshot documentation in console

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js (201098 => 201099)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js	2016-05-18 20:42:20 UTC (rev 201098)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js	2016-05-18 21:04:27 UTC (rev 201099)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2013, 2014, 2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -40,6 +40,9 @@
         WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.AutoContinueDidChange, this._breakpointEditablePropertyDidChange, this);
         WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ActionsDidChange, this._breakpointEditablePropertyDidChange, this);
 
+        WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingWillStart, this._timelineCapturingWillStart, this);
+        WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStopped, this._timelineCapturingStopped, this);
+
         WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
 
         this._allExceptionsBreakpointEnabledSetting = new WebInspector.Setting("break-on-all-exceptions", false);
@@ -345,34 +348,6 @@
         return knownScripts;
     }
 
-    get breakpointsDisabledTemporarily()
-    {
-        return this._temporarilyDisabledBreakpointsRestoreSetting.value !== null;
-    }
-
-    startDisablingBreakpointsTemporarily()
-    {
-        console.assert(this._temporarilyDisabledBreakpointsRestoreSetting.value === null, "Already temporarily disabling breakpoints.");
-        if (this._temporarilyDisabledBreakpointsRestoreSetting.value !== null)
-            return;
-
-        this._temporarilyDisabledBreakpointsRestoreSetting.value = this._breakpointsEnabledSetting.value;
-
-        this.breakpointsEnabled = false;
-    }
-
-    stopDisablingBreakpointsTemporarily()
-    {
-        console.assert(this._temporarilyDisabledBreakpointsRestoreSetting.value !== null, "Was not temporarily disabling breakpoints.");
-        if (this._temporarilyDisabledBreakpointsRestoreSetting.value === null)
-            return;
-
-        let restoreState = this._temporarilyDisabledBreakpointsRestoreSetting.value;
-        this._temporarilyDisabledBreakpointsRestoreSetting.value = null;
-
-        this.breakpointsEnabled = restoreState;
-    }
-
     addBreakpoint(breakpoint, skipEventDispatch, shouldSpeculativelyResolve)
     {
         console.assert(breakpoint instanceof WebInspector.Breakpoint, "Bad argument to DebuggerManger.addBreakpoint: ", breakpoint);
@@ -890,6 +865,47 @@
         }
     }
 
+    get breakpointsDisabledTemporarily()
+    {
+        return this._temporarilyDisabledBreakpointsRestoreSetting.value !== null;
+    }
+
+    _startDisablingBreakpointsTemporarily()
+    {
+        console.assert(!this.breakpointsDisabledTemporarily, "Already temporarily disabling breakpoints.");
+        if (this.breakpointsDisabledTemporarily)
+            return;
+
+        this._temporarilyDisabledBreakpointsRestoreSetting.value = this._breakpointsEnabledSetting.value;
+
+        this.breakpointsEnabled = false;
+    }
+
+    _stopDisablingBreakpointsTemporarily()
+    {
+        console.assert(this.breakpointsDisabledTemporarily, "Was not temporarily disabling breakpoints.");
+        if (!this.breakpointsDisabledTemporarily)
+            return;
+
+        let restoreState = this._temporarilyDisabledBreakpointsRestoreSetting.value;
+        this._temporarilyDisabledBreakpointsRestoreSetting.value = null;
+
+        this.breakpointsEnabled = restoreState;
+    }
+
+    _timelineCapturingWillStart(event)
+    {
+        this._startDisablingBreakpointsTemporarily();
+
+        if (this.paused)
+            this.resume();
+    }
+
+    _timelineCapturingStopped(event)
+    {
+        this._stopDisablingBreakpointsTemporarily();
+    }
+
     _mainResourceDidChange(event)
     {
         if (!event.target.isMainFrame())

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js (201098 => 201099)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js	2016-05-18 20:42:20 UTC (rev 201098)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js	2016-05-18 21:04:27 UTC (rev 201099)
@@ -46,8 +46,8 @@
         WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange, this._debuggerActiveCallFrameDidChange, this);
         WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.WaitingToPause, this._debuggerWaitingToPause, this);
 
-        WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingWillStart, this._timelineRecordingWillStart, this);
-        WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStopped, this._timelineRecordingStopped, this);        
+        WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingWillStart, this._timelineCapturingWillStart, this);
+        WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStopped, this._timelineCapturingStopped, this);
 
         this._timelineRecordingWarningElement = document.createElement("div");
         this._timelineRecordingWarningElement.classList.add("timeline-recording-warning");
@@ -429,23 +429,16 @@
         this._addIssuesForSourceCode(resource);
     }
 
-    _timelineRecordingWillStart(event)
+    _timelineCapturingWillStart(event)
     {
-        WebInspector.debuggerManager.startDisablingBreakpointsTemporarily();
-
-        if (WebInspector.debuggerManager.paused)
-            WebInspector.debuggerManager.resume();
-
         this._debuggerBreakpointsButtonItem.enabled = false;
         this._debuggerPauseResumeButtonItem.enabled = false;
 
         this.contentView.element.insertBefore(this._timelineRecordingWarningElement, this.contentView.element.firstChild);
     }
 
-    _timelineRecordingStopped(event)
+    _timelineCapturingStopped(event)
     {
-        WebInspector.debuggerManager.stopDisablingBreakpointsTemporarily();
-
         this._debuggerBreakpointsButtonItem.enabled = true;
         this._debuggerPauseResumeButtonItem.enabled = true;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to