2011-01-17 Pavel Feldman <pfeldman@chromium.org>
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Jan 2011 14:31:13 +0000 (14:31 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Jan 2011 14:31:13 +0000 (14:31 +0000)
        Reviewed by Yury Semikhatsky.

        Web Inspector: simplify debugger enabling routine.
        https://bugs.webkit.org/show_bug.cgi?id=52472

        * inspector/Inspector.idl:
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::restoreDebugger):
        (WebCore::InspectorController::showAndEnableDebugger):
        (WebCore::InspectorController::enableDebugger):
        * inspector/InspectorController.h:
        * inspector/front-end/DebuggerModel.js:
        * inspector/front-end/ScriptsPanel.js:
        (WebInspector.ScriptsPanel.prototype.show):
        (WebInspector.ScriptsPanel.prototype._toggleDebugging):
2011-01-17  Pavel Feldman  <pfeldman@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: simplify debugger enabling routine.
        https://bugs.webkit.org/show_bug.cgi?id=52472

        * WebInspector/WebInspector.mm:
        (-[WebInspector startDebuggingJavaScript:]):
2011-01-17  Pavel Feldman  <pfeldman@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: simplify debugger enabling routine.
        https://bugs.webkit.org/show_bug.cgi?id=52472

        * WebInspector.cpp:
        (WebInspector::toggleDebuggingJavaScript):
2011-01-17  Pavel Feldman  <pfeldman@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: simplify debugger enabling routine.
        https://bugs.webkit.org/show_bug.cgi?id=52472

        * WebProcess/WebPage/WebInspector.cpp:
        (WebKit::WebInspector::startJavaScriptDebugging):

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

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/inspector/Inspector.idl
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorController.h
Source/WebCore/inspector/front-end/DebuggerModel.js
Source/WebCore/inspector/front-end/ScriptsPanel.js
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebInspector/WebInspector.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebInspector.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebInspector.cpp

index ada7216..fb20e73 100644 (file)
@@ -1,3 +1,21 @@
+2011-01-17  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: simplify debugger enabling routine.
+        https://bugs.webkit.org/show_bug.cgi?id=52472
+
+        * inspector/Inspector.idl:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::restoreDebugger):
+        (WebCore::InspectorController::showAndEnableDebugger):
+        (WebCore::InspectorController::enableDebugger):
+        * inspector/InspectorController.h:
+        * inspector/front-end/DebuggerModel.js:
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype.show):
+        (WebInspector.ScriptsPanel.prototype._toggleDebugging):
+
 2011-01-17  Pavel Podivilov  <podivilov@chromium.org>
 
         Reviewed by Pavel Feldman.
index a77730e..cac7485 100644 (file)
@@ -1350,7 +1350,7 @@ __ZN7WebCore15InspectorClient31doDispatchMessageOnFrontendPageEPNS_4PageERKN3WTF
 __ZN7WebCore19InspectorController12ConsolePanelE
 __ZN7WebCore19InspectorController12ScriptsPanelE
 __ZN7WebCore19InspectorController13ProfilesPanelE
-__ZN7WebCore19InspectorController14enableDebuggerEv
+__ZN7WebCore19InspectorController21showAndEnableDebuggerEv
 __ZN7WebCore19InspectorController14enableProfilerEbb
 __ZN7WebCore19InspectorController15disableDebuggerEb
 __ZN7WebCore19InspectorController15disableProfilerEb
index 05c8849..6563508 100644 (file)
@@ -221,7 +221,7 @@ module core {
         // Debugger API
         ///////////////////////////////////////////////////////////////////////
 
-        [domain=Inspector] void enableDebuggerFromFrontend(in boolean always);
+        [domain=Inspector] void enableDebugger(in boolean always);
         [domain=Inspector] void disableDebugger(in boolean always);
 
         [domain=Inspector] void setStickyBreakpoints(in Object breakpoints);
@@ -229,8 +229,6 @@ module core {
         [notify, domain=Debugger] void debuggerWasEnabled();
         [notify, domain=Debugger] void debuggerWasDisabled();
 
-        [notify, domain=Debugger] void attachDebuggerWhenShown(); // FIXME: do something with this eventually.
-
         [notify, domain=Debugger] void parsedScriptSource(out String sourceID, out String url, out int lineOffset, out int columnOffset, out int scriptWorldType);
         [notify, domain=Debugger] void failedToParseScriptSource(out String url, out String data, out int firstLine, out int errorLine, out String errorMessage);
 
index 4cf6b4b..aa0bec6 100644 (file)
@@ -582,11 +582,9 @@ void InspectorController::restoreDebugger()
 {
     ASSERT(m_frontend);
 #if ENABLE(JAVASCRIPT_DEBUGGER)
-    if (InspectorDebuggerAgent::isDebuggerAlwaysEnabled())
-        enableDebuggerFromFrontend(false);
-    else {
-        if (m_settings->getBoolean(InspectorSettings::DebuggerAlwaysEnabled) || m_attachDebuggerWhenShown)
-            enableDebugger();
+    if (InspectorDebuggerAgent::isDebuggerAlwaysEnabled() || m_attachDebuggerWhenShown || m_settings->getBoolean(InspectorSettings::DebuggerAlwaysEnabled)) {
+        enableDebugger(false);
+        m_attachDebuggerWhenShown = false;
     }
 #endif
 }
@@ -1036,7 +1034,22 @@ void InspectorController::disableProfiler(bool always)
 #endif
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
-void InspectorController::enableDebuggerFromFrontend(bool always)
+void InspectorController::showAndEnableDebugger()
+{
+    if (!enabled())
+        return;
+
+    if (debuggerEnabled())
+        return;
+
+    if (!m_frontend) {
+        m_attachDebuggerWhenShown = true;
+        showPanel(ScriptsPanel);
+    } else
+        enableDebugger(false);
+}
+
+void InspectorController::enableDebugger(bool always)
 {
     ASSERT(!debuggerEnabled());
     if (always)
@@ -1051,22 +1064,6 @@ void InspectorController::enableDebuggerFromFrontend(bool always)
     m_frontend->debuggerWasEnabled();
 }
 
-void InspectorController::enableDebugger()
-{
-    if (!enabled())
-        return;
-
-    if (debuggerEnabled())
-        return;
-
-    if (!m_frontend)
-        m_attachDebuggerWhenShown = true;
-    else {
-        m_frontend->attachDebuggerWhenShown();
-        m_attachDebuggerWhenShown = false;
-    }
-}
-
 void InspectorController::disableDebugger(bool always)
 {
     if (!enabled())
index 39d7f90..37ba25b 100644 (file)
@@ -215,7 +215,8 @@ public:
     void disableProfiler(bool always = false);
     bool profilerEnabled() const;
 
-    void enableDebugger();
+    void showAndEnableDebugger();
+    void enableDebugger(bool always);
     void disableDebugger(bool always = false);
     bool debuggerEnabled() const { return m_debuggerAgent; }
     void resume();
@@ -273,7 +274,6 @@ private:
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     void toggleRecordButton(bool);
-    void enableDebuggerFromFrontend(bool always);
     void restoreStickyBreakpoints();
     void restoreStickyBreakpoint(PassRefPtr<InspectorObject> breakpoint);
 #endif
index b056e30..8f5bcf7 100644 (file)
@@ -224,11 +224,6 @@ WebInspector.DebuggerDispatcher.prototype = {
         this._debuggerModel._resumedScript();
     },
 
-    attachDebuggerWhenShown: function()
-    {
-        WebInspector.panels.scripts.attachDebuggerWhenShown();
-    },
-
     debuggerWasEnabled: function()
     {
         WebInspector.panels.scripts.debuggerWasEnabled();
index 82c1b39..32212d4 100644 (file)
@@ -218,11 +218,6 @@ WebInspector.ScriptsPanel.prototype = {
 
         if (this.visibleView)
             this.visibleView.show(this.viewsContainerElement);
-
-        if (this._attachDebuggerWhenShown) {
-            InspectorBackend.enableDebuggerFromFrontend(false);
-            delete this._attachDebuggerWhenShown;
-        }
     },
 
     hide: function()
@@ -395,15 +390,6 @@ WebInspector.ScriptsPanel.prototype = {
         this._clearInterface();
     },
 
-    attachDebuggerWhenShown: function()
-    {
-        if (this.element.parentElement) {
-            InspectorBackend.enableDebuggerFromFrontend(false);
-        } else {
-            this._attachDebuggerWhenShown = true;
-        }
-    },
-
     debuggerWasEnabled: function()
     {
         if (this._debuggerEnabled)
@@ -863,7 +849,7 @@ WebInspector.ScriptsPanel.prototype = {
         if (this._debuggerEnabled)
             InspectorBackend.disableDebugger(true);
         else
-            InspectorBackend.enableDebuggerFromFrontend(!!optionalAlways);
+            InspectorBackend.enableDebugger(!!optionalAlways);
     },
 
     _togglePauseOnExceptions: function()
index 9169abb..0646b13 100644 (file)
@@ -1,3 +1,13 @@
+2011-01-17  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: simplify debugger enabling routine.
+        https://bugs.webkit.org/show_bug.cgi?id=52472
+
+        * WebInspector/WebInspector.mm:
+        (-[WebInspector startDebuggingJavaScript:]):
+
 2011-01-16  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Simon Fraser.
index f109e15..8ab049f 100644 (file)
@@ -96,8 +96,7 @@ using namespace WebCore;
     Page* page = core(_webView);
     if (!page)
         return;
-    page->inspectorController()->showPanel(InspectorController::ScriptsPanel);
-    page->inspectorController()->enableDebugger();
+    page->inspectorController()->showAndEnableDebugger();
 }
 
 - (void)stopDebuggingJavaScript:(id)sender
index 318ae95..1c30ba1 100644 (file)
@@ -1,3 +1,13 @@
+2011-01-17  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: simplify debugger enabling routine.
+        https://bugs.webkit.org/show_bug.cgi?id=52472
+
+        * WebInspector.cpp:
+        (WebInspector::toggleDebuggingJavaScript):
+
 2011-01-16  Adam Barth  <abarth@webkit.org>
 
         Rubber-stamped by Eric Seidel.
index 0337711..c3823b2 100644 (file)
@@ -170,10 +170,8 @@ HRESULT STDMETHODCALLTYPE WebInspector::toggleDebuggingJavaScript()
 
     if (inspector->debuggerEnabled())
         inspector->disableDebugger();
-    else {
-        inspector->showPanel(InspectorController::ScriptsPanel);
-        inspector->enableDebugger();
-    }
+    else
+        inspector->showAndEnableDebugger();
 
     return S_OK;
 }
index ef94588..a8c5a20 100644 (file)
@@ -1,3 +1,13 @@
+2011-01-17  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: simplify debugger enabling routine.
+        https://bugs.webkit.org/show_bug.cgi?id=52472
+
+        * WebProcess/WebPage/WebInspector.cpp:
+        (WebKit::WebInspector::startJavaScriptDebugging):
+
 2011-01-17  Balazs Kelemen  <kbalazs@webkit.org>
 
         Reviewed by Andreas Kling.
index ad294f6..559b8b6 100644 (file)
@@ -99,8 +99,7 @@ void WebInspector::showConsole()
 void WebInspector::startJavaScriptDebugging()
 {
 #if ENABLE(JAVASCRIPT_DEBUGGER)
-    m_page->corePage()->inspectorController()->showPanel(InspectorController::ScriptsPanel);
-    m_page->corePage()->inspectorController()->enableDebugger();
+    m_page->corePage()->inspectorController()->showAndEnableDebugger();
 #endif
 }