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

        Web Inspector: [REGRESSION introduced in r77950] Develop -> Start Debugging JavaScript does not open Web Inspector.
        https://bugs.webkit.org/show_bug.cgi?id=54277

        * inspector/InspectorAgent.cpp:
        (WebCore::InspectorAgent::populateScriptObjects):
        (WebCore::InspectorAgent::stopUserInitiatedProfiling):
        (WebCore::InspectorAgent::showAndEnableDebugger):
        (WebCore::InspectorAgent::showPanel):
        * inspector/InspectorAgent.h:
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::showAndEnableDebugger):
        (WebCore::InspectorController::stopUserInitiatedProfiling):

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

Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorAgent.cpp
Source/WebCore/inspector/InspectorAgent.h
Source/WebCore/inspector/InspectorController.cpp

index 76992e7..116a01b 100644 (file)
@@ -1,3 +1,20 @@
+2011-02-14  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: [REGRESSION introduced in r77950] Develop -> Start Debugging JavaScript does not open Web Inspector.
+        https://bugs.webkit.org/show_bug.cgi?id=54277
+
+        * inspector/InspectorAgent.cpp:
+        (WebCore::InspectorAgent::populateScriptObjects):
+        (WebCore::InspectorAgent::stopUserInitiatedProfiling):
+        (WebCore::InspectorAgent::showAndEnableDebugger):
+        (WebCore::InspectorAgent::showPanel):
+        * inspector/InspectorAgent.h:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::showAndEnableDebugger):
+        (WebCore::InspectorController::stopUserInitiatedProfiling):
+
 2011-02-14  Kenichi Ishibashi  <bashi@chromium.org>
 
         Reviewed by Andreas Kling.
 2011-02-14  Kenichi Ishibashi  <bashi@chromium.org>
 
         Reviewed by Andreas Kling.
index 9559099..8116e45 100644 (file)
@@ -438,9 +438,9 @@ void InspectorAgent::populateScriptObjects()
     if (m_nodeToFocus)
         focusNode();
 
     if (m_nodeToFocus)
         focusNode();
 
-    if (!m_requiredPanel.isEmpty()) {
-        m_frontend->showPanel(m_requiredPanel);
-        m_requiredPanel = "";
+    if (!m_showPanelAfterVisible.isEmpty()) {
+        m_frontend->showPanel(m_showPanelAfterVisible);
+        m_showPanelAfterVisible = "";
     }
 
     restoreDebugger(true);
     }
 
     restoreDebugger(true);
@@ -852,8 +852,6 @@ void InspectorAgent::startUserInitiatedProfiling()
 
 void InspectorAgent::stopUserInitiatedProfiling()
 {
 
 void InspectorAgent::stopUserInitiatedProfiling()
 {
-    if (!enabled())
-        return;
     m_profilerAgent->stopUserInitiatedProfiling();
     m_state->setBoolean(InspectorAgentState::userInitiatedProfiling, false);
     showPanel(profilesPanelName);
     m_profilerAgent->stopUserInitiatedProfiling();
     m_state->setBoolean(InspectorAgentState::userInitiatedProfiling, false);
     showPanel(profilesPanelName);
@@ -880,17 +878,16 @@ void InspectorAgent::disableProfiler()
 #endif
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
 #endif
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
-void InspectorAgent::showAndEnableDebugger()
+void InspectorAgent::startUserInitiatedDebugging()
 {
 {
-    if (!enabled())
-        return;
-
     if (debuggerEnabled())
         return;
 
     if (debuggerEnabled())
         return;
 
+    showPanel(scriptsPanelName);
     if (!m_frontend) {
     if (!m_frontend) {
+        // We are called after show(), set the debuggerEnabled flag so that it was enabled
+        // upon frontend opening.
         m_state->setBoolean(InspectorAgentState::debuggerEnabled, true);
         m_state->setBoolean(InspectorAgentState::debuggerEnabled, true);
-        showPanel(scriptsPanelName);
     } else
         enableDebugger(true);
 }
     } else
         enableDebugger(true);
 }
@@ -1258,7 +1255,7 @@ void InspectorAgent::showConsole()
 void InspectorAgent::showPanel(const String& panel)
 {
     if (!m_frontend) {
 void InspectorAgent::showPanel(const String& panel)
 {
     if (!m_frontend) {
-        m_requiredPanel = panel;
+        m_showPanelAfterVisible = panel;
         return;
     }
     m_frontend->showPanel(panel);
         return;
     }
     m_frontend->showPanel(panel);
index 1f14dd9..eadb988 100644 (file)
@@ -214,7 +214,7 @@ public:
     void disableProfiler();
     bool profilerEnabled() const;
 
     void disableProfiler();
     bool profilerEnabled() const;
 
-    void showAndEnableDebugger();
+    void startUserInitiatedDebugging();
     void enableDebugger() { enableDebugger(false); }
     void enableDebugger(bool eraseStickyBreakpoints);
     void disableDebugger();
     void enableDebugger() { enableDebugger(false); }
     void enableDebugger(bool eraseStickyBreakpoints);
     void disableDebugger();
@@ -306,7 +306,7 @@ private:
     OwnPtr<InspectorConsoleAgent> m_consoleAgent;
 
     Vector<pair<long, String> > m_pendingEvaluateTestCommands;
     OwnPtr<InspectorConsoleAgent> m_consoleAgent;
 
     Vector<pair<long, String> > m_pendingEvaluateTestCommands;
-    String m_requiredPanel;
+    String m_showPanelAfterVisible;
     Vector<String> m_scriptsToEvaluateOnLoad;
     String m_inspectorExtensionAPI;
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     Vector<String> m_scriptsToEvaluateOnLoad;
     String m_inspectorExtensionAPI;
 #if ENABLE(JAVASCRIPT_DEBUGGER)
index 426e5f3..327d834 100644 (file)
@@ -215,7 +215,10 @@ bool InspectorController::debuggerEnabled()
 
 void InspectorController::showAndEnableDebugger()
 {
 
 void InspectorController::showAndEnableDebugger()
 {
-    m_inspectorAgent->showAndEnableDebugger();
+    if (!enabled())
+        return;
+    show();
+    m_inspectorAgent->startUserInitiatedDebugging();
 }
 
 void InspectorController::disableDebugger()
 }
 
 void InspectorController::disableDebugger()
@@ -230,6 +233,9 @@ void InspectorController::startUserInitiatedProfiling()
 
 void InspectorController::stopUserInitiatedProfiling()
 {
 
 void InspectorController::stopUserInitiatedProfiling()
 {
+    if (!enabled())
+        return;
+    show();
     m_inspectorAgent->stopUserInitiatedProfiling();
 }
 
     m_inspectorAgent->stopUserInitiatedProfiling();
 }