Title: [126009] trunk
Revision
126009
Author
[email protected]
Date
2012-08-20 02:00:16 -0700 (Mon, 20 Aug 2012)

Log Message

Web Inspector: prepare scripts panel to be lazily loaded
https://bugs.webkit.org/show_bug.cgi?id=94423

Reviewed by Vsevolod Vlasov.

Source/WebCore:

- makes scripts panel read workspace data upon creation
- moves pause on script state management into the debugger model
- updates frontend API to use debugger model, not scripts panel

* inspector/front-end/DebuggerModel.js:
(WebInspector.DebuggerModel.prototype.debuggerEnabled):
(WebInspector.DebuggerModel.prototype.disableDebugger):
(WebInspector.DebuggerModel.prototype._debuggerWasEnabled):
(WebInspector.DebuggerModel.prototype._pauseOnExceptionStateChanged):
(WebInspector.DebuggerModel.prototype.get _debuggerWasDisabled):
* inspector/front-end/InspectorFrontendAPI.js:
(InspectorFrontendAPI._pendingCommands.isDebuggingEnabled):
(InspectorFrontendAPI.setDebuggingEnabled):
* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel):
(WebInspector.ScriptsPanel.prototype._debuggerWasEnabled):
(WebInspector.ScriptsPanel.prototype._debuggerWasDisabled):
(WebInspector.ScriptsPanel.prototype._reset):
(WebInspector.ScriptsPanel.prototype.canShowAnchorLocation):
(WebInspector.ScriptsPanel.prototype._updateDebuggerButtons):
(WebInspector.ScriptsPanel.prototype._enableDebugging):
(WebInspector.ScriptsPanel.prototype._togglePauseOnExceptions):
(WebInspector.ScriptsPanel.prototype.showGoToSourceDialog):
* inspector/front-end/inspector.js:
(WebInspector.documentKeyDown):

LayoutTests:

* http/tests/inspector/debugger-test.js:
(initialize_DebuggerTest.InspectorTest.finishDebuggerTest.disableDebugger):
* inspector/debugger/debugger-autocontinue-on-syntax-error.html:
* inspector/debugger/debugger-pause-in-internal.html:
* inspector/debugger/debugger-pause-on-exception.html:
* inspector/debugger/scripts-panel-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (126008 => 126009)


--- trunk/LayoutTests/ChangeLog	2012-08-20 08:47:04 UTC (rev 126008)
+++ trunk/LayoutTests/ChangeLog	2012-08-20 09:00:16 UTC (rev 126009)
@@ -1,3 +1,17 @@
+2012-08-20  Pavel Feldman  <[email protected]>
+
+        Web Inspector: prepare scripts panel to be lazily loaded
+        https://bugs.webkit.org/show_bug.cgi?id=94423
+
+        Reviewed by Vsevolod Vlasov.
+
+        * http/tests/inspector/debugger-test.js:
+        (initialize_DebuggerTest.InspectorTest.finishDebuggerTest.disableDebugger):
+        * inspector/debugger/debugger-autocontinue-on-syntax-error.html:
+        * inspector/debugger/debugger-pause-in-internal.html:
+        * inspector/debugger/debugger-pause-on-exception.html:
+        * inspector/debugger/scripts-panel-expected.txt:
+
 2012-08-20  Allan Sandfeld Jensen  <[email protected]>
 
         Unreviewed gardening, remove FAIL expectation fixed by r126006

Modified: trunk/LayoutTests/http/tests/inspector/debugger-test.js (126008 => 126009)


--- trunk/LayoutTests/http/tests/inspector/debugger-test.js	2012-08-20 08:47:04 UTC (rev 126008)
+++ trunk/LayoutTests/http/tests/inspector/debugger-test.js	2012-08-20 09:00:16 UTC (rev 126009)
@@ -6,11 +6,11 @@
         InspectorTest._quiet = quiet;
     WebInspector.showPanel("scripts");
 
-    if (WebInspector.panels.scripts._debuggerEnabled)
+    if (WebInspector.debuggerModel.debuggerEnabled())
         startTest();
     else {
         InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasEnabled", startTest);
-        WebInspector.panels.scripts.toggleDebugging(false);
+        WebInspector.debuggerModel.enableDebugger();
     }
 
     function startTest()
@@ -31,11 +31,11 @@
 
     function disableDebugger()
     {
-        if (!scriptsPanel._debuggerEnabled)
+        if (!WebInspector.debuggerModel.debuggerEnabled())
             completeTest();
         else {
             InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasDisabled", debuggerDisabled);
-            scriptsPanel.toggleDebugging(false);
+            WebInspector.debuggerModel.disableDebugger();
         }
     }
 

Modified: trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error.html (126008 => 126009)


--- trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error.html	2012-08-20 08:47:04 UTC (rev 126008)
+++ trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error.html	2012-08-20 09:00:16 UTC (rev 126009)
@@ -18,7 +18,7 @@
 
     function step1()
     {
-        DebuggerAgent.setPauseOnExceptions(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
+        DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
         InspectorTest.addConsoleSniffer(step2);
         InspectorTest.evaluateInPage("loadIframe()");
     }

Modified: trunk/LayoutTests/inspector/debugger/debugger-pause-in-internal.html (126008 => 126009)


--- trunk/LayoutTests/inspector/debugger/debugger-pause-in-internal.html	2012-08-20 08:47:04 UTC (rev 126008)
+++ trunk/LayoutTests/inspector/debugger/debugger-pause-in-internal.html	2012-08-20 09:00:16 UTC (rev 126009)
@@ -20,7 +20,7 @@
 
     function step1()
     {
-        DebuggerAgent.setPauseOnExceptions(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
+        DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
         InspectorTest.showScriptSource("debugger-pause-in-internal.html", step2);
     }
 

Modified: trunk/LayoutTests/inspector/debugger/debugger-pause-on-exception.html (126008 => 126009)


--- trunk/LayoutTests/inspector/debugger/debugger-pause-on-exception.html	2012-08-20 08:47:04 UTC (rev 126008)
+++ trunk/LayoutTests/inspector/debugger/debugger-pause-on-exception.html	2012-08-20 09:00:16 UTC (rev 126009)
@@ -20,7 +20,7 @@
 
     function step1()
     {
-        DebuggerAgent.setPauseOnExceptions(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
+        DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
         InspectorTest.showScriptSource("debugger-pause-on-exception.html", step2);
     }
 

Modified: trunk/LayoutTests/inspector/debugger/scripts-panel-expected.txt (126008 => 126009)


--- trunk/LayoutTests/inspector/debugger/scripts-panel-expected.txt	2012-08-20 08:47:04 UTC (rev 126008)
+++ trunk/LayoutTests/inspector/debugger/scripts-panel-expected.txt	2012-08-20 09:00:16 UTC (rev 126009)
@@ -6,6 +6,7 @@
   bar.js
   baz.js
   foo.js
+  foobar.js
 Dumping ScriptsNavigator 'Content scripts' tab:
 Source requested for baz.js
 

Modified: trunk/LayoutTests/platform/mac/TestExpectations (126008 => 126009)


--- trunk/LayoutTests/platform/mac/TestExpectations	2012-08-20 08:47:04 UTC (rev 126008)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2012-08-20 09:00:16 UTC (rev 126009)
@@ -370,13 +370,6 @@
 
 BUGWK93247 DEBUG : fast/lists/list-marker-remove-crash.html = CRASH
 
-// REGRESSION (r124723-r124741): 5 inspector/debugger tests failing on Apple Lion Debug WK1 (Tests)
-BUGWK93387 :  inspector/debugger/script-formatter-breakpoints.html = TEXT
-BUGWK93387 :  inspector/debugger/pause-in-internal-script.html = TEXT
-BUGWK93387 :  inspector/debugger/watch-expressions-panel-switch.html = TEXT
-BUGWK93387 :  inspector/debugger/debugger-activation-crash2.html = TEXT
-BUGWK93387 :  inspector/debugger/debugger-set-breakpoint-regex.html = TEXT
-
 // (r124484) inspector/device-orientation-success.html failing on Mac ports
 BUGWK93552 : inspector/device-orientation-success.html = TEXT
 

Modified: trunk/Source/WebCore/ChangeLog (126008 => 126009)


--- trunk/Source/WebCore/ChangeLog	2012-08-20 08:47:04 UTC (rev 126008)
+++ trunk/Source/WebCore/ChangeLog	2012-08-20 09:00:16 UTC (rev 126009)
@@ -1,3 +1,36 @@
+2012-08-20  Pavel Feldman  <[email protected]>
+
+        Web Inspector: prepare scripts panel to be lazily loaded
+        https://bugs.webkit.org/show_bug.cgi?id=94423
+
+        Reviewed by Vsevolod Vlasov.
+
+        - makes scripts panel read workspace data upon creation
+        - moves pause on script state management into the debugger model
+        - updates frontend API to use debugger model, not scripts panel
+
+        * inspector/front-end/DebuggerModel.js:
+        (WebInspector.DebuggerModel.prototype.debuggerEnabled):
+        (WebInspector.DebuggerModel.prototype.disableDebugger):
+        (WebInspector.DebuggerModel.prototype._debuggerWasEnabled):
+        (WebInspector.DebuggerModel.prototype._pauseOnExceptionStateChanged):
+        (WebInspector.DebuggerModel.prototype.get _debuggerWasDisabled):
+        * inspector/front-end/InspectorFrontendAPI.js:
+        (InspectorFrontendAPI._pendingCommands.isDebuggingEnabled):
+        (InspectorFrontendAPI.setDebuggingEnabled):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel):
+        (WebInspector.ScriptsPanel.prototype._debuggerWasEnabled):
+        (WebInspector.ScriptsPanel.prototype._debuggerWasDisabled):
+        (WebInspector.ScriptsPanel.prototype._reset):
+        (WebInspector.ScriptsPanel.prototype.canShowAnchorLocation):
+        (WebInspector.ScriptsPanel.prototype._updateDebuggerButtons):
+        (WebInspector.ScriptsPanel.prototype._enableDebugging):
+        (WebInspector.ScriptsPanel.prototype._togglePauseOnExceptions):
+        (WebInspector.ScriptsPanel.prototype.showGoToSourceDialog):
+        * inspector/front-end/inspector.js:
+        (WebInspector.documentKeyDown):
+
 2012-08-20  Robin Cao  <[email protected]>
 
         [BlackBerry] Adapt to changes in the platform media player API

Modified: trunk/Source/WebCore/inspector/front-end/DebuggerModel.js (126008 => 126009)


--- trunk/Source/WebCore/inspector/front-end/DebuggerModel.js	2012-08-20 08:47:04 UTC (rev 126008)
+++ trunk/Source/WebCore/inspector/front-end/DebuggerModel.js	2012-08-20 09:00:16 UTC (rev 126009)
@@ -34,6 +34,8 @@
  */
 WebInspector.DebuggerModel = function()
 {
+    InspectorBackend.registerDebuggerDispatcher(new WebInspector.DebuggerDispatcher(this));
+
     this._debuggerPausedDetails = null;
     /**
      * @type {Object.<string, WebInspector.Script>}
@@ -44,9 +46,20 @@
     this._canSetScriptSource = false;
     this._breakpointsActive = true;
 
-    InspectorBackend.registerDebuggerDispatcher(new WebInspector.DebuggerDispatcher(this));
+    WebInspector.settings.pauseOnExceptionStateString = WebInspector.settings.createSetting("pauseOnExceptionStateString", WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions);
+    WebInspector.settings.pauseOnExceptionStateString.addChangeListener(this._pauseOnExceptionStateChanged, this);
+
+    if (!Capabilities.debuggerCausesRecompilation || WebInspector.settings.debuggerEnabled.get())
+        this.enableDebugger();
 }
 
+// Keep these in sync with WebCore::ScriptDebugServer
+WebInspector.DebuggerModel.PauseOnExceptionsState = {
+    DontPauseOnExceptions : "none",
+    PauseOnAllExceptions : "all",
+    PauseOnUncaughtExceptions: "uncaught"
+};
+
 /**
  * @constructor
  * @implements {WebInspector.RawLocation}
@@ -85,8 +98,19 @@
 }
 
 WebInspector.DebuggerModel.prototype = {
+    /**
+     * @return {boolean}
+     */
+    debuggerEnabled: function()
+    {
+        return !!this._debuggerEnabled;
+    },
+
     enableDebugger: function()
     {
+        if (this._debuggerEnabled)
+            return;
+
         function callback(error, result)
         {
             this._canSetScriptSource = result;
@@ -97,6 +121,9 @@
 
     disableDebugger: function()
     {
+        if (!this._debuggerEnabled)
+            return;
+
         DebuggerAgent.disable(this._debuggerWasDisabled.bind(this));
     },
 
@@ -110,11 +137,19 @@
 
     _debuggerWasEnabled: function()
     {
+        this._debuggerEnabled = true;
+        this._pauseOnExceptionStateChanged();
         this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerWasEnabled);
     },
 
+    _pauseOnExceptionStateChanged: function()
+    {
+        DebuggerAgent.setPauseOnExceptions(WebInspector.settings.pauseOnExceptionStateString.get());
+    },
+
     _debuggerWasDisabled: function()
     {
+        this._debuggerEnabled = false;
         this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerWasDisabled);
     },
 

Modified: trunk/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js (126008 => 126009)


--- trunk/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js	2012-08-20 08:47:04 UTC (rev 126008)
+++ trunk/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js	2012-08-20 09:00:16 UTC (rev 126009)
@@ -33,16 +33,16 @@
 
     isDebuggingEnabled: function()
     {
-        return WebInspector.panels.scripts.debuggingEnabled;
+        return WebInspector.debuggerModel.debuggerEnabled();
     },
 
     setDebuggingEnabled: function(enabled)
     {
         if (enabled) {
-            WebInspector.panels.scripts.enableDebugging();
-            WebInspector.inspectorView.setCurrentPanel(WebInspector.panels.scripts);
+            WebInspector.debuggerModel.enableDebugger();
+            WebInspector.showPanel("scripts");
         } else
-            WebInspector.panels.scripts.disableDebugging();
+            WebInspector.debuggerModel.disableDebugger();
     },
 
     isTimelineProfilingEnabled: function()

Modified: trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js (126008 => 126009)


--- trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2012-08-20 08:47:04 UTC (rev 126008)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2012-08-20 09:00:16 UTC (rev 126009)
@@ -36,7 +36,6 @@
     WebInspector.Panel.call(this, "scripts");
     this.registerRequiredCSS("scriptsPanel.css");
 
-    WebInspector.settings.pauseOnExceptionStateString = WebInspector.settings.createSetting("pauseOnExceptionStateString", WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions);
     WebInspector.settings.navigatorWasOnceHidden = WebInspector.settings.createSetting("navigatorWasOnceHidden", false);
     WebInspector.settings.debuggerSidebarHidden = WebInspector.settings.createSetting("debuggerSidebarHidden", false);
 
@@ -136,10 +135,10 @@
     var panelEnablerButton = WebInspector.UIString("Enable Debugging");
 
     this.panelEnablerView = new WebInspector.PanelEnablerView("scripts", panelEnablerHeading, panelEnablerDisclaimer, panelEnablerButton);
-    this.panelEnablerView.addEventListener("enable clicked", this.enableDebugging, this);
+    this.panelEnablerView.addEventListener("enable clicked", this._enableDebugging, this);
 
     this.enableToggleButton = new WebInspector.StatusBarButton("", "enable-toggle-status-bar-item");
-    this.enableToggleButton.addEventListener("click", this.toggleDebugging, this);
+    this.enableToggleButton.addEventListener("click", this._toggleDebugging, this);
     if (!Capabilities.debuggerCausesRecompilation)
         this.enableToggleButton.element.addStyleClass("hidden");
 
@@ -153,12 +152,16 @@
     this._scriptViewStatusBarItemsContainer = document.createElement("div");
     this._scriptViewStatusBarItemsContainer.style.display = "inline-block";
 
-    this._debuggerEnabled = !Capabilities.debuggerCausesRecompilation;
     this._installDebuggerSidebarController();
 
     this._sourceFramesByUISourceCode = new Map();
-    this._reset(false);
+    this._updateDebuggerButtons();
+    this._pauseOnExceptionStateChanged();
 
+    if (WebInspector.debuggerModel.isPaused())
+        this._debuggerPaused();
+
+    WebInspector.settings.pauseOnExceptionStateString.addChangeListener(this._pauseOnExceptionStateChanged, this);
     WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasEnabled, this._debuggerWasEnabled, this);
     WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasDisabled, this._debuggerWasDisabled, this);
     WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused, this._debuggerPaused, this);
@@ -168,26 +171,19 @@
     WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ExecutionLineChanged, this._executionLineChanged, this);
     WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointsActiveStateChanged, this._breakpointsActiveStateChanged, this);
 
+    var uiSourceCodes = this._workspace.uiSourceCodes();
+    for (var i = 0; i < uiSourceCodes.length; ++i)
+        this._addUISourceCode(uiSourceCodes[i]);
+
     this._workspace.addEventListener(WebInspector.UISourceCodeProvider.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this);
     this._workspace.addEventListener(WebInspector.UISourceCodeProvider.Events.UISourceCodeReplaced, this._uiSourceCodeReplaced, this);
     this._workspace.addEventListener(WebInspector.UISourceCodeProvider.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this);
-    this._workspace.addEventListener(WebInspector.Workspace.Events.WorkspaceReset, this._reset.bind(this, false), this);
+    this._workspace.addEventListener(WebInspector.Workspace.Events.WorkspaceReset, this._reset.bind(this), this);
 
-    var enableDebugger = !Capabilities.debuggerCausesRecompilation || WebInspector.settings.debuggerEnabled.get();
-    if (enableDebugger)
-        WebInspector.debuggerModel.enableDebugger();
-
     WebInspector.advancedSearchController.registerSearchScope(new WebInspector.ScriptsSearchScope(this._workspace));
     WebInspector.ContextMenu.registerProvider(this);
 }
 
-// Keep these in sync with WebCore::ScriptDebugServer
-WebInspector.ScriptsPanel.PauseOnExceptionsState = {
-    DontPauseOnExceptions : "none",
-    PauseOnAllExceptions : "all",
-    PauseOnUncaughtExceptions: "uncaught"
-};
-
 WebInspector.ScriptsPanel.prototype = {
     get statusBarItems()
     {
@@ -253,9 +249,9 @@
         this.sidebarPanes.scopechain.update(WebInspector.debuggerModel.selectedCallFrame());
     },
 
-    _debuggerPaused: function(event)
+    _debuggerPaused: function()
     {
-        var details = /** @type {WebInspector.DebuggerPausedDetails} */ event.data;
+        var details = WebInspector.debuggerModel.debuggerPausedDetails();
 
         this._paused = true;
         this._waitingToPause = false;
@@ -313,25 +309,15 @@
 
     _debuggerWasEnabled: function()
     {
-        this._setPauseOnExceptions(WebInspector.settings.pauseOnExceptionStateString.get());
-
-        if (this._debuggerEnabled)
-            return;
-
-        this._debuggerEnabled = true;
-        this._reset(true);
+        this._updateDebuggerButtons();
     },
 
     _debuggerWasDisabled: function()
     {
-        if (!this._debuggerEnabled)
-            return;
-
-        this._debuggerEnabled = false;
-        this._reset(true);
+        this._reset();
     },
 
-    _reset: function(preserveItems)
+    _reset: function()
     {
         delete this.currentQuery;
         this.searchCanceled();
@@ -369,7 +355,7 @@
 
     canShowAnchorLocation: function(anchor)
     {
-        if (this._debuggerEnabled && anchor.uiSourceCode)
+        if (WebInspector.debuggerModel.debuggerEnabled() && anchor.uiSourceCode)
             return true;
         var uiSourceCodes = this._workspace.uiSourceCodes();
         for (var i = 0; i < uiSourceCodes.length; ++i) {
@@ -567,29 +553,24 @@
             sourceFrame.focus();
     },
 
-    _setPauseOnExceptions: function(pauseOnExceptionsState)
+    _pauseOnExceptionStateChanged: function()
     {
-        pauseOnExceptionsState = pauseOnExceptionsState || WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions;
-        function callback(error)
-        {
-            if (error)
-                return;
-            if (pauseOnExceptionsState == WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions)
-                this._pauseOnExceptionButton.title = WebInspector.UIString("Don't pause on exceptions.\nClick to Pause on all exceptions.");
-            else if (pauseOnExceptionsState == WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnAllExceptions)
-                this._pauseOnExceptionButton.title = WebInspector.UIString("Pause on all exceptions.\nClick to Pause on uncaught exceptions.");
-            else if (pauseOnExceptionsState == WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions)
-                this._pauseOnExceptionButton.title = WebInspector.UIString("Pause on uncaught exceptions.\nClick to Not pause on exceptions.");
-
-            this._pauseOnExceptionButton.state = pauseOnExceptionsState;
-            WebInspector.settings.pauseOnExceptionStateString.set(pauseOnExceptionsState);
+        switch (WebInspector.settings.pauseOnExceptionStateString.get()) {
+        case WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions:
+            this._pauseOnExceptionButton.title = WebInspector.UIString("Don't pause on exceptions.\nClick to Pause on all exceptions.");
+            break;
+        case WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions:
+            this._pauseOnExceptionButton.title = WebInspector.UIString("Pause on all exceptions.\nClick to Pause on uncaught exceptions.");
+            break;
+        case WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions:
+            this._pauseOnExceptionButton.title = WebInspector.UIString("Pause on uncaught exceptions.\nClick to Not pause on exceptions.");
+            break;
         }
-        DebuggerAgent.setPauseOnExceptions(pauseOnExceptionsState, callback.bind(this));
     },
 
     _updateDebuggerButtons: function()
     {
-        if (this._debuggerEnabled) {
+        if (WebInspector.debuggerModel.debuggerEnabled()) {
             this.enableToggleButton.title = WebInspector.UIString("Debugging enabled. Click to disable.");
             this.enableToggleButton.toggled = true;
             this._pauseOnExceptionButton.visible = true;
@@ -640,32 +621,18 @@
         this._updateDebuggerButtons();
     },
 
-    get debuggingEnabled()
+    _enableDebugging: function()
     {
-        return this._debuggerEnabled;
+        this._toggleDebugging(this.panelEnablerView.alwaysEnabled);
     },
 
-    enableDebugging: function()
+    _toggleDebugging: function(optionalAlways)
     {
-        if (this._debuggerEnabled)
-            return;
-        this.toggleDebugging(this.panelEnablerView.alwaysEnabled);
-    },
-
-    disableDebugging: function()
-    {
-        if (!this._debuggerEnabled)
-            return;
-        this.toggleDebugging(this.panelEnablerView.alwaysEnabled);
-    },
-
-    toggleDebugging: function(optionalAlways)
-    {
         this._paused = false;
         this._waitingToPause = false;
         this._stepping = false;
 
-        if (this._debuggerEnabled) {
+        if (WebInspector.debuggerModel.debuggerEnabled()) {
             WebInspector.settings.debuggerEnabled.set(false);
             WebInspector.debuggerModel.disableDebugger();
         } else {
@@ -677,11 +644,11 @@
     _togglePauseOnExceptions: function()
     {
         var nextStateMap = {};
-        var stateEnum = WebInspector.ScriptsPanel.PauseOnExceptionsState;
+        var stateEnum = WebInspector.DebuggerModel.PauseOnExceptionsState;
         nextStateMap[stateEnum.DontPauseOnExceptions] = stateEnum.PauseOnAllExceptions;
         nextStateMap[stateEnum.PauseOnAllExceptions] = stateEnum.PauseOnUncaughtExceptions;
         nextStateMap[stateEnum.PauseOnUncaughtExceptions] = stateEnum.DontPauseOnExceptions;
-        this._setPauseOnExceptions(nextStateMap[this._pauseOnExceptionButton.state]);
+        WebInspector.settings.pauseOnExceptionStateString.set(nextStateMap[this._pauseOnExceptionButton.state]);
     },
 
     _togglePause: function()
@@ -1111,7 +1078,6 @@
 
     showGoToSourceDialog: function()
     {
-        WebInspector.inspectorView.setCurrentPanel(this);
         WebInspector.OpenResourceDialog.show(this, this._workspace, this.editorView.mainElement);
     }
 }

Modified: trunk/Source/WebCore/inspector/front-end/inspector.js (126008 => 126009)


--- trunk/Source/WebCore/inspector/front-end/inspector.js	2012-08-20 08:47:04 UTC (rev 126008)
+++ trunk/Source/WebCore/inspector/front-end/inspector.js	2012-08-20 09:00:16 UTC (rev 126009)
@@ -470,8 +470,6 @@
     this.console.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, this._updateErrorAndWarningCounts, this);
     this.console.addEventListener(WebInspector.ConsoleModel.Events.RepeatCountUpdated, this._updateErrorAndWarningCounts, this);
 
-    this.debuggerModel = new WebInspector.DebuggerModel();
-
     WebInspector.CSSCompletions.requestCSSNameCompletions();
 
     this.drawer = new WebInspector.Drawer();
@@ -479,6 +477,7 @@
 
     this.networkManager = new WebInspector.NetworkManager();
     this.resourceTreeModel = new WebInspector.ResourceTreeModel(this.networkManager);
+    this.debuggerModel = new WebInspector.DebuggerModel();
     this.networkLog = new WebInspector.NetworkLog();
     this.domAgent = new WebInspector.DOMAgent();
     this._javascript_ContextManager = new WebInspector._javascript_ContextManager(this.resourceTreeModel, this.consoleView);
@@ -788,7 +787,7 @@
     switch (event.keyIdentifier) {
         case "U+004F": // O key
             if (!event.shiftKey && !event.altKey && WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)) {
-                WebInspector.panels.scripts.showGoToSourceDialog();
+                WebInspector.showPanel("scripts").showGoToSourceDialog();
                 event.consume(true);
             }
             break;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to