[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

loislo at chromium.org loislo at chromium.org
Wed Dec 22 11:10:29 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit d1acf2f322e433f6fb2e30c91c06de06127d5813
Author: loislo at chromium.org <loislo at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jul 14 11:34:36 2010 +0000

    2010-07-14  Ilya Tikhonovsky  <loislo at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            WebInspector: Clean-up InspectorBackend code. In the next changes
            InspectorBackend content will be generated by scripts. As far as
            generator is very simple thing all nontrivial function should be
            moved to InspectorController and DOMAgent.
            https://bugs.webkit.org/show_bug.cgi?id=42171
    
            * bindings/js/ScriptDebugServer.cpp:
            (WebCore::ScriptDebugServer::pause):
            * bindings/js/ScriptDebugServer.h:
            (WebCore::ScriptDebugServer::activateBreakpoints):
            (WebCore::ScriptDebugServer::deactivateBreakpoints):
            * bindings/v8/ScriptDebugServer.h:
            (WebCore::ScriptDebugServer::activateBreakpoints):
            (WebCore::ScriptDebugServer::deactivateBreakpoints):
            (WebCore::ScriptDebugServer::pause):
            * inspector/Inspector.idl:
            * inspector/InspectorBackend.cpp:
            (WebCore::InspectorBackend::saveApplicationSettings):
            (WebCore::InspectorBackend::saveSessionSettings):
            (WebCore::InspectorBackend::enableSearchingForNode):
            (WebCore::InspectorBackend::disableSearchingForNode):
            (WebCore::InspectorBackend::enableMonitoringXHR):
            (WebCore::InspectorBackend::disableMonitoringXHR):
            (WebCore::InspectorBackend::getResourceContent):
            (WebCore::InspectorBackend::reloadPage):
            (WebCore::InspectorBackend::activateBreakpoints):
            (WebCore::InspectorBackend::deactivateBreakpoints):
            (WebCore::InspectorBackend::pause):
            (WebCore::InspectorBackend::resume):
            (WebCore::InspectorBackend::stepOverStatement):
            (WebCore::InspectorBackend::stepIntoStatement):
            (WebCore::InspectorBackend::stepOutOfFunction):
            (WebCore::InspectorBackend::setPauseOnExceptionsState):
            (WebCore::InspectorBackend::copyNode):
            (WebCore::InspectorBackend::pushNodeByPathToFrontend):
            (WebCore::InspectorBackend::highlightDOMNode):
            (WebCore::InspectorBackend::hideDOMNodeHighlight):
            * inspector/InspectorBackend.h:
            * inspector/InspectorBackend.idl:
            * inspector/InspectorController.cpp:
            (WebCore::InspectorController::saveApplicationSettings):
            (WebCore::InspectorController::saveSessionSettings):
            (WebCore::InspectorController::highlightDOMNode):
            (WebCore::InspectorController::resume):
            (WebCore::InspectorController::setPauseOnExceptionsState):
            (WebCore::InspectorController::getResourceContent):
            (WebCore::InspectorController::reloadPage):
            * inspector/InspectorController.h:
            (WebCore::InspectorController::hideDOMNodeHighlight):
            (WebCore::InspectorController::startProfiling):
            (WebCore::InspectorController::stopProfiling):
            (WebCore::InspectorController::enableSearchingForNode):
            (WebCore::InspectorController::disableSearchingForNode):
            (WebCore::InspectorController::enableMonitoringXHR):
            (WebCore::InspectorController::disableMonitoringXHR):
            * inspector/InspectorDOMAgent.cpp:
            (WebCore::InspectorDOMAgent::copyNode):
            (WebCore::InspectorDOMAgent::pushNodeByPathToFrontend):
            * inspector/InspectorDOMAgent.h:
            * inspector/front-end/InspectorBackendStub.js:
            (.WebInspector.InspectorBackendStub.prototype.pause):
            (.WebInspector.InspectorBackendStub.prototype.resume):
            (.WebInspector.InspectorBackendStub.prototype.stepIntoStatement):
            (.WebInspector.InspectorBackendStub.prototype.stepOutOfFunction):
            (.WebInspector.InspectorBackendStub.prototype.stepOverStatement):
            * inspector/front-end/ScriptsPanel.js:
            (WebInspector.ScriptsPanel.prototype._togglePause):
            (WebInspector.ScriptsPanel.prototype._stepOverClicked):
            (WebInspector.ScriptsPanel.prototype._stepIntoClicked):
            (WebInspector.ScriptsPanel.prototype._stepOutClicked):
            * loader/FrameLoader.cpp:
            (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
    
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63309 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 17da874..be92514 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,80 @@
+2010-07-14  Ilya Tikhonovsky  <loislo at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        WebInspector: Clean-up InspectorBackend code. In the next changes
+        InspectorBackend content will be generated by scripts. As far as
+        generator is very simple thing all nontrivial function should be
+        moved to InspectorController and DOMAgent.
+        https://bugs.webkit.org/show_bug.cgi?id=42171
+
+        * bindings/js/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::pause):
+        * bindings/js/ScriptDebugServer.h:
+        (WebCore::ScriptDebugServer::activateBreakpoints):
+        (WebCore::ScriptDebugServer::deactivateBreakpoints):
+        * bindings/v8/ScriptDebugServer.h:
+        (WebCore::ScriptDebugServer::activateBreakpoints):
+        (WebCore::ScriptDebugServer::deactivateBreakpoints):
+        (WebCore::ScriptDebugServer::pause):
+        * inspector/Inspector.idl:
+        * inspector/InspectorBackend.cpp:
+        (WebCore::InspectorBackend::saveApplicationSettings):
+        (WebCore::InspectorBackend::saveSessionSettings):
+        (WebCore::InspectorBackend::enableSearchingForNode):
+        (WebCore::InspectorBackend::disableSearchingForNode):
+        (WebCore::InspectorBackend::enableMonitoringXHR):
+        (WebCore::InspectorBackend::disableMonitoringXHR):
+        (WebCore::InspectorBackend::getResourceContent):
+        (WebCore::InspectorBackend::reloadPage):
+        (WebCore::InspectorBackend::activateBreakpoints):
+        (WebCore::InspectorBackend::deactivateBreakpoints):
+        (WebCore::InspectorBackend::pause):
+        (WebCore::InspectorBackend::resume):
+        (WebCore::InspectorBackend::stepOverStatement):
+        (WebCore::InspectorBackend::stepIntoStatement):
+        (WebCore::InspectorBackend::stepOutOfFunction):
+        (WebCore::InspectorBackend::setPauseOnExceptionsState):
+        (WebCore::InspectorBackend::copyNode):
+        (WebCore::InspectorBackend::pushNodeByPathToFrontend):
+        (WebCore::InspectorBackend::highlightDOMNode):
+        (WebCore::InspectorBackend::hideDOMNodeHighlight):
+        * inspector/InspectorBackend.h:
+        * inspector/InspectorBackend.idl:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::saveApplicationSettings):
+        (WebCore::InspectorController::saveSessionSettings):
+        (WebCore::InspectorController::highlightDOMNode):
+        (WebCore::InspectorController::resume):
+        (WebCore::InspectorController::setPauseOnExceptionsState):
+        (WebCore::InspectorController::getResourceContent):
+        (WebCore::InspectorController::reloadPage):
+        * inspector/InspectorController.h:
+        (WebCore::InspectorController::hideDOMNodeHighlight):
+        (WebCore::InspectorController::startProfiling):
+        (WebCore::InspectorController::stopProfiling):
+        (WebCore::InspectorController::enableSearchingForNode):
+        (WebCore::InspectorController::disableSearchingForNode):
+        (WebCore::InspectorController::enableMonitoringXHR):
+        (WebCore::InspectorController::disableMonitoringXHR):
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::copyNode):
+        (WebCore::InspectorDOMAgent::pushNodeByPathToFrontend):
+        * inspector/InspectorDOMAgent.h:
+        * inspector/front-end/InspectorBackendStub.js:
+        (.WebInspector.InspectorBackendStub.prototype.pause):
+        (.WebInspector.InspectorBackendStub.prototype.resume):
+        (.WebInspector.InspectorBackendStub.prototype.stepIntoStatement):
+        (.WebInspector.InspectorBackendStub.prototype.stepOutOfFunction):
+        (.WebInspector.InspectorBackendStub.prototype.stepOverStatement):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype._togglePause):
+        (WebInspector.ScriptsPanel.prototype._stepOverClicked):
+        (WebInspector.ScriptsPanel.prototype._stepIntoClicked):
+        (WebInspector.ScriptsPanel.prototype._stepOutClicked):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
+
 2010-07-14  Joone Hur  <joone at kldp.org>
 
         Reviewed by Jian Li.
diff --git a/WebCore/bindings/js/ScriptDebugServer.cpp b/WebCore/bindings/js/ScriptDebugServer.cpp
index 0a40f13..d71034b 100644
--- a/WebCore/bindings/js/ScriptDebugServer.cpp
+++ b/WebCore/bindings/js/ScriptDebugServer.cpp
@@ -200,7 +200,7 @@ void ScriptDebugServer::setPauseOnExceptionsState(PauseOnExceptionsState pause)
     m_pauseOnExceptionsState = pause;
 }
 
-void ScriptDebugServer::pauseProgram()
+void ScriptDebugServer::pause()
 {
     m_pauseOnNextStatement = true;
 }
diff --git a/WebCore/bindings/js/ScriptDebugServer.h b/WebCore/bindings/js/ScriptDebugServer.h
index 6a8209b..fd8976b 100644
--- a/WebCore/bindings/js/ScriptDebugServer.h
+++ b/WebCore/bindings/js/ScriptDebugServer.h
@@ -67,6 +67,8 @@ public:
     void removeBreakpoint(const String& sourceID, unsigned lineNumber);
     void clearBreakpoints();
     void setBreakpointsActivated(bool activated);
+    void activateBreakpoints() { setBreakpointsActivated(true); }
+    void deactivateBreakpoints() { setBreakpointsActivated(false); }
 
     enum PauseOnExceptionsState {
         DontPauseOnExceptions,
@@ -76,7 +78,7 @@ public:
     PauseOnExceptionsState pauseOnExceptionsState() const { return m_pauseOnExceptionsState; }
     void setPauseOnExceptionsState(PauseOnExceptionsState);
 
-    void pauseProgram();
+    void pause();
     void continueProgram();
     void stepIntoStatement();
     void stepOverStatement();
diff --git a/WebCore/bindings/v8/ScriptDebugServer.h b/WebCore/bindings/v8/ScriptDebugServer.h
index 26ca785..7021c0a 100644
--- a/WebCore/bindings/v8/ScriptDebugServer.h
+++ b/WebCore/bindings/v8/ScriptDebugServer.h
@@ -59,6 +59,8 @@ public:
     void removeBreakpoint(const String& sourceID, unsigned lineNumber);
     void clearBreakpoints();
     void setBreakpointsActivated(bool activated);
+    void activateBreakpoints() { setBreakpointsActivated(true); }
+    void deactivateBreakpoints() { setBreakpointsActivated(false); }
 
     enum PauseOnExceptionsState {
         DontPauseOnExceptions,
@@ -68,7 +70,7 @@ public:
     PauseOnExceptionsState pauseOnExceptionsState();
     void setPauseOnExceptionsState(PauseOnExceptionsState pauseOnExceptionsState);
 
-    void pauseProgram() { }
+    void pause() { }
     void continueProgram();
     void stepIntoStatement();
     void stepOverStatement();
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
index cb6a68b..476d040 100644
--- a/WebCore/inspector/Inspector.idl
+++ b/WebCore/inspector/Inspector.idl
@@ -70,12 +70,12 @@ module core {
         void activateBreakpoints();
         void deactivateBreakpoints();
 
-        void pauseInDebugger();
-        void resumeDebugger();
+        void pause();
+        void resume();
 
-        void stepOverStatementInDebugger();
-        void stepIntoStatementInDebugger();
-        void stepOutOfFunctionInDebugger();
+        void stepOverStatement();
+        void stepIntoStatement();
+        void stepOutOfFunction();
 
         void setPauseOnExceptionsState(in long pauseOnExceptionsState);
 
@@ -103,7 +103,7 @@ module core {
         void removeAllScriptsToEvaluateOnLoad();
 
         void getChildNodes(in long nodeId);
-        [custorResponse=didApplyDomChange] void setAttribute(in long elementId, in String name, in String value, out boolean success);
+        [customResponse=didApplyDomChange] void setAttribute(in long elementId, in String name, in String value, out boolean success);
         [customResponse=didApplyDomChange] void removeAttribute(in long elementId, in String name, out boolean success);
         void setTextNodeValue(in long nodeId, in String value);
         void getEventListenersForNode(in long nodeId, out long nodeId, out Array listenersArray);
@@ -115,7 +115,7 @@ module core {
         void addInspectedNode(in long nodeId);
         void performSearch(in String query, in boolean runSynchronously);
         void searchCanceled();
-        void pushNodeByPathToFrontend(in String path);
+        void pushNodeByPathToFrontend(in String path, out long nodeId);
 
         void clearConsoleMessages();
 
@@ -138,7 +138,7 @@ module core {
         void getCookies();
         void deleteCookie(in String cookieName, in String domain);
 
-#if defined(ENABLE_OFFLINE_WEB_APPLICATIONS)
+#if defined(ENABLE_OFFLINE_WEB_APPLICATIONS) && ENABLE_OFFLINE_WEB_APPLICATIONS
         void getApplicationCaches();
 #endif
 
diff --git a/WebCore/inspector/InspectorBackend.cpp b/WebCore/inspector/InspectorBackend.cpp
index 57ee19f..9f71307 100644
--- a/WebCore/inspector/InspectorBackend.cpp
+++ b/WebCore/inspector/InspectorBackend.cpp
@@ -86,13 +86,13 @@ InspectorBackend::~InspectorBackend()
 void InspectorBackend::saveApplicationSettings(const String& settings)
 {
     if (m_inspectorController)
-        m_inspectorController->setSetting(InspectorController::frontendSettingsSettingName(), settings);
+        m_inspectorController->saveApplicationSettings(settings);
 }
 
 void InspectorBackend::saveSessionSettings(const String& settings)
 {
     if (m_inspectorController)
-        m_inspectorController->setSessionSettings(settings);
+        m_inspectorController->saveSessionSettings(settings);
 }
 
 void InspectorBackend::storeLastActivePanel(const String& panelName)
@@ -104,25 +104,25 @@ void InspectorBackend::storeLastActivePanel(const String& panelName)
 void InspectorBackend::enableSearchingForNode()
 {
     if (m_inspectorController)
-        m_inspectorController->setSearchingForNode(true);
+        m_inspectorController->enableSearchingForNode();
 }
 
 void InspectorBackend::disableSearchingForNode()
 {
     if (m_inspectorController)
-        m_inspectorController->setSearchingForNode(false);
+        m_inspectorController->disableSearchingForNode();
 }
 
 void InspectorBackend::enableMonitoringXHR()
 {
     if (m_inspectorController)
-        m_inspectorController->setMonitoringXHR(true);
+        m_inspectorController->enableMonitoringXHR();
 }
 
 void InspectorBackend::disableMonitoringXHR()
 {
     if (m_inspectorController)
-        m_inspectorController->setMonitoringXHR(false);
+        m_inspectorController->disableMonitoringXHR();
 }
 
 void InspectorBackend::enableResourceTracking(bool always)
@@ -139,21 +139,14 @@ void InspectorBackend::disableResourceTracking(bool always)
 
 void InspectorBackend::getResourceContent(long callId, unsigned long identifier)
 {
-    InspectorFrontend* frontend = inspectorFrontend();
-    if (!frontend)
-        return;
-
-    RefPtr<InspectorResource> resource = m_inspectorController->resources().get(identifier);
-    if (resource)
-        frontend->didGetResourceContent(callId, resource->sourceString());
-    else
-        frontend->didGetResourceContent(callId, "");
+    if (m_inspectorController)
+        m_inspectorController->getResourceContent(callId, identifier);
 }
 
 void InspectorBackend::reloadPage()
 {
     if (m_inspectorController)
-        m_inspectorController->m_inspectedPage->mainFrame()->redirectScheduler()->scheduleRefresh(true);
+        m_inspectorController->reloadPage();
 }
 
 void InspectorBackend::startTimelineProfiler()
@@ -196,45 +189,44 @@ void InspectorBackend::removeBreakpoint(const String& sourceID, unsigned lineNum
 
 void InspectorBackend::activateBreakpoints()
 {
-    ScriptDebugServer::shared().setBreakpointsActivated(true);
+    ScriptDebugServer::shared().activateBreakpoints();
 }
 
 void InspectorBackend::deactivateBreakpoints()
 {
-    ScriptDebugServer::shared().setBreakpointsActivated(false);
+    ScriptDebugServer::shared().deactivateBreakpoints();
 }
 
-void InspectorBackend::pauseInDebugger()
+void InspectorBackend::pause()
 {
-    ScriptDebugServer::shared().pauseProgram();
+    ScriptDebugServer::shared().pause();
 }
 
-void InspectorBackend::resumeDebugger()
+void InspectorBackend::resume()
 {
     if (m_inspectorController)
-        m_inspectorController->resumeDebugger();
+        m_inspectorController->resume();
 }
 
-void InspectorBackend::stepOverStatementInDebugger()
+void InspectorBackend::stepOverStatement()
 {
     ScriptDebugServer::shared().stepOverStatement();
 }
 
-void InspectorBackend::stepIntoStatementInDebugger()
+void InspectorBackend::stepIntoStatement()
 {
     ScriptDebugServer::shared().stepIntoStatement();
 }
 
-void InspectorBackend::stepOutOfFunctionInDebugger()
+void InspectorBackend::stepOutOfFunction()
 {
     ScriptDebugServer::shared().stepOutOfFunction();
 }
 
 void InspectorBackend::setPauseOnExceptionsState(long pauseState)
 {
-    ScriptDebugServer::shared().setPauseOnExceptionsState(static_cast<ScriptDebugServer::PauseOnExceptionsState>(pauseState));
-    if (InspectorFrontend* frontend = inspectorFrontend())
-        frontend->updatePauseOnExceptionsState(ScriptDebugServer::shared().pauseOnExceptionsState());
+    if (m_inspectorController)
+        m_inspectorController->setPauseOnExceptionsState(pauseState);
 }
 
 void InspectorBackend::editScriptSource(long callId, const String& sourceID, const String& newContent)
@@ -368,11 +360,8 @@ void InspectorBackend::getEventListenersForNode(long callId, long nodeId)
 
 void InspectorBackend::copyNode(long nodeId)
 {
-    Node* node = nodeForId(nodeId);
-    if (!node)
-        return;
-    String markup = createMarkup(node);
-    Pasteboard::generalPasteboard()->writePlainText(markup);
+    if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+        domAgent->copyNode(nodeId);
 }
 
 void InspectorBackend::removeNode(long callId, long nodeId)
@@ -419,13 +408,8 @@ void InspectorBackend::searchCanceled()
 
 void InspectorBackend::pushNodeByPathToFrontend(long callId, const String& path)
 {
-    InspectorDOMAgent* domAgent = inspectorDOMAgent();
-    InspectorFrontend* frontend = inspectorFrontend();
-    if (!domAgent || !frontend)
-        return;
-    
-    long id = domAgent->pushNodeByPathToFrontend(path);
-    frontend->didPushNodeByPathToFrontend(callId, id);
+    if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+        domAgent->pushNodeByPathToFrontend(callId, path);
 }
 
 void InspectorBackend::clearConsoleMessages()
@@ -508,14 +492,14 @@ void InspectorBackend::addRule(long callId, const String& selector, long selecte
 
 void InspectorBackend::highlightDOMNode(long nodeId)
 {
-    if (Node* node = nodeForId(nodeId))
-        m_inspectorController->highlight(node);
+    if (m_inspectorController)
+        m_inspectorController->highlightDOMNode(nodeId);
 }
 
 void InspectorBackend::hideDOMNodeHighlight()
 {
     if (m_inspectorController)
-        m_inspectorController->hideHighlight();
+        m_inspectorController->hideDOMNodeHighlight();
 }
 
 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
@@ -613,13 +597,6 @@ InspectorFrontend* InspectorBackend::inspectorFrontend()
     return m_inspectorController->m_frontend.get();
 }
 
-Node* InspectorBackend::nodeForId(long nodeId)
-{
-    if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
-        return domAgent->nodeForId(nodeId);
-    return 0;
-}
-
 void InspectorBackend::addScriptToEvaluateOnLoad(const String& source)
 {
     if (m_inspectorController)
diff --git a/WebCore/inspector/InspectorBackend.h b/WebCore/inspector/InspectorBackend.h
index 47cfdc7..78d34b6 100644
--- a/WebCore/inspector/InspectorBackend.h
+++ b/WebCore/inspector/InspectorBackend.h
@@ -86,12 +86,12 @@ public:
     void activateBreakpoints();
     void deactivateBreakpoints();
 
-    void pauseInDebugger();
-    void resumeDebugger();
+    void pause();
+    void resume();
 
-    void stepOverStatementInDebugger();
-    void stepIntoStatementInDebugger();
-    void stepOutOfFunctionInDebugger();
+    void stepOverStatement();
+    void stepIntoStatement();
+    void stepOutOfFunction();
 
     void setPauseOnExceptionsState(long pauseState);
 
diff --git a/WebCore/inspector/InspectorBackend.idl b/WebCore/inspector/InspectorBackend.idl
index 1fc8a16..3c460a1 100644
--- a/WebCore/inspector/InspectorBackend.idl
+++ b/WebCore/inspector/InspectorBackend.idl
@@ -60,12 +60,12 @@ module core {
         void activateBreakpoints();
         void deactivateBreakpoints();
 
-        void pauseInDebugger();
-        void resumeDebugger();
+        void pause();
+        void resume();
 
-        void stepOverStatementInDebugger();
-        void stepIntoStatementInDebugger();
-        void stepOutOfFunctionInDebugger();
+        void stepOverStatement();
+        void stepIntoStatement();
+        void stepOutOfFunction();
 
         void setPauseOnExceptionsState(in long pauseOnExceptionsState);
 
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 0e48902..e90aff8 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -265,7 +265,12 @@ void InspectorController::setSetting(const String& key, const String& value)
     m_client->storeSetting(key, value);
 }
 
-void InspectorController::setSessionSettings(const String& settingsJSON)
+void InspectorController::saveApplicationSettings(const String& settings)
+{
+    setSetting(InspectorController::frontendSettingsSettingName(), settings);
+}
+
+void InspectorController::saveSessionSettings(const String& settingsJSON)
 {
     m_sessionSettings = InspectorValue::parseJSON(settingsJSON);
 }
@@ -311,6 +316,13 @@ void InspectorController::highlight(Node* node)
     m_client->highlight(node);
 }
 
+void InspectorController::highlightDOMNode(long nodeId)
+{
+    Node* node = 0;
+    if (m_domAgent && (node = m_domAgent->nodeForId(nodeId)))
+        highlight(node);
+}
+
 void InspectorController::hideHighlight()
 {
     if (!enabled())
@@ -1741,13 +1753,20 @@ void InspectorController::getScriptSource(long callId, const String& sourceID)
     m_frontend->didGetScriptSource(callId, scriptSource);
 }
 
-void InspectorController::resumeDebugger()
+void InspectorController::resume()
 {
     if (!m_debuggerEnabled)
         return;
     ScriptDebugServer::shared().continueProgram();
 }
 
+void InspectorController::setPauseOnExceptionsState(long pauseState)
+{
+    ScriptDebugServer::shared().setPauseOnExceptionsState(static_cast<ScriptDebugServer::PauseOnExceptionsState>(pauseState));
+    if (m_frontend)
+        m_frontend->updatePauseOnExceptionsState(ScriptDebugServer::shared().pauseOnExceptionsState());
+}
+
 PassRefPtr<SerializedScriptValue> InspectorController::currentCallFrames()
 {
     if (!m_pausedScriptState)
@@ -2154,6 +2173,23 @@ void InspectorController::removeAllScriptsToEvaluateOnLoad()
     m_scriptsToEvaluateOnLoad.clear();
 }
 
+void InspectorController::getResourceContent(long callId, unsigned long identifier)
+{
+    if (!m_frontend)
+        return;
+
+    RefPtr<InspectorResource> resource = m_resources.get(identifier);
+    if (resource)
+        m_frontend->didGetResourceContent(callId, resource->sourceString());
+    else
+        m_frontend->didGetResourceContent(callId, "");
+}
+
+void InspectorController::reloadPage()
+{
+    m_inspectedPage->mainFrame()->redirectScheduler()->scheduleRefresh(true);
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index c87baeb..1411bd0 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -127,14 +127,19 @@ public:
     bool enabled() const;
 
     Page* inspectedPage() const { return m_inspectedPage; }
+    void reloadPage();
 
     String setting(const String& key) const;
     void setSetting(const String& key, const String& value);
-    void setSessionSettings(const String&);
+    void saveApplicationSettings(const String& settings);
+    void saveSessionSettings(const String&);
+
 
     void inspect(Node*);
     void highlight(Node*);
     void hideHighlight();
+    void highlightDOMNode(long nodeId);
+    void hideDOMNodeHighlight() { hideHighlight(); }
 
     void show();
     void showPanel(SpecialPanels);
@@ -246,6 +251,8 @@ public:
     String getCurrentUserInitiatedProfileName(bool incrementProfileNumber);
     void startUserInitiatedProfiling(Timer<InspectorController>* = 0);
     void stopUserInitiatedProfiling();
+    void startProfiling() { startUserInitiatedProfiling(); }
+    void stopProfiling() { stopUserInitiatedProfiling(); }
 
     void enableProfiler(bool always = false, bool skipRecompile = false);
     void disableProfiler(bool always = false);
@@ -260,7 +267,8 @@ public:
     void editScriptSource(long callId, const String& sourceID, const String& newContent);
     void getScriptSource(long callId, const String& sourceID);
 
-    void resumeDebugger();
+    void resume();
+    void setPauseOnExceptionsState(long pauseState);
     PassRefPtr<SerializedScriptValue> currentCallFrames();
 
     virtual void didParseSource(const String& sourceID, const String& url, const String& data, int firstLine, ScriptWorldType);
@@ -288,7 +296,12 @@ private:
 
     // Following are used from InspectorBackend and internally.
     void setSearchingForNode(bool enabled);
+    void enableSearchingForNode() { setSearchingForNode(true); }
+    void disableSearchingForNode() { setSearchingForNode(false); }
+
     void setMonitoringXHR(bool enabled);
+    void enableMonitoringXHR() { setMonitoringXHR(true); }
+    void disableMonitoringXHR() { setMonitoringXHR(false); }
     void storeLastActivePanel(const String& panelName);
     InspectorDOMAgent* domAgent() { return m_domAgent.get(); }
     void releaseFrontendLifetimeAgents();
@@ -324,6 +337,7 @@ private:
     void addResource(InspectorResource*);
     void removeResource(InspectorResource*);
     InspectorResource* getTrackedResource(unsigned long identifier);
+    void getResourceContent(long callId, unsigned long identifier);
 
     void pruneResources(ResourcesMap*, DocumentLoader* loaderToKeep = 0);
     void removeAllResources(ResourcesMap* map) { pruneResources(map); }
diff --git a/WebCore/inspector/InspectorDOMAgent.cpp b/WebCore/inspector/InspectorDOMAgent.cpp
index 4946fae..e3d1bf5 100644
--- a/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/WebCore/inspector/InspectorDOMAgent.cpp
@@ -58,6 +58,7 @@
 #include "MutationEvent.h"
 #include "Node.h"
 #include "NodeList.h"
+#include "Pasteboard.h"
 #include "PlatformString.h"
 #include "RemoteInspectorFrontend.h"
 #include "RenderStyle.h"
@@ -70,6 +71,8 @@
 #include "XPathResult.h"
 #endif
 
+#include "markup.h"
+
 #include <wtf/text/CString.h>
 #include <wtf/HashSet.h>
 #include <wtf/ListHashSet.h>
@@ -354,14 +357,6 @@ void InspectorDOMAgent::pushChildNodesToFrontend(long nodeId)
     m_frontend->setChildNodes(nodeId, children.release());
 }
 
-long InspectorDOMAgent::pushNodeByPathToFrontend(const String& path)
-{
-    Node* node = nodeForPath(path);
-    if (!node)
-        return 0;
-    return pushNodePathToFrontend(node);
-}
-
 long InspectorDOMAgent::inspectedNode(unsigned long num)
 {
     if (num < m_inspectedNodes.size())
@@ -1635,6 +1630,28 @@ void InspectorDOMAgent::reportNodesAsSearchResults(ListHashSet<Node*>& resultCol
     m_frontend->addNodesToSearchResult(nodeIds.release());
 }
 
+void InspectorDOMAgent::copyNode(long nodeId)
+{
+    Node* node = nodeForId(nodeId);
+    if (!node)
+        return;
+    String markup = createMarkup(node);
+    Pasteboard::generalPasteboard()->writePlainText(markup);
+}
+
+void InspectorDOMAgent::pushNodeByPathToFrontend(long callId, const String& path)
+{
+    if (!m_frontend)
+        return;
+
+    long id = 0;
+    Node* node = nodeForPath(path);
+    if (node)
+        id = pushNodePathToFrontend(node);
+
+    m_frontend->didPushNodeByPathToFrontend(callId, id);
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/InspectorDOMAgent.h b/WebCore/inspector/InspectorDOMAgent.h
index 7cd5a07..6f9c5fb 100644
--- a/WebCore/inspector/InspectorDOMAgent.h
+++ b/WebCore/inspector/InspectorDOMAgent.h
@@ -135,8 +135,9 @@ namespace WebCore {
         Node* nodeForId(long nodeId);
         long pushNodePathToFrontend(Node* node);
         void pushChildNodesToFrontend(long nodeId);
-        long pushNodeByPathToFrontend(const String& path);
+        void pushNodeByPathToFrontend(long callId, const String& path);
         long inspectedNode(unsigned long num);
+        void copyNode(long nodeId);
 
     private:
         static CSSStyleSheet* getParentStyleSheet(CSSStyleDeclaration*);
diff --git a/WebCore/inspector/front-end/InspectorBackendStub.js b/WebCore/inspector/front-end/InspectorBackendStub.js
index 761e876..857e026 100644
--- a/WebCore/inspector/front-end/InspectorBackendStub.js
+++ b/WebCore/inspector/front-end/InspectorBackendStub.js
@@ -184,7 +184,7 @@ WebInspector.InspectorBackendStub.prototype = {
         this._breakpointsActivated = false;
     },
 
-    pauseInDebugger: function()
+    pause: function()
     {
     },
 
@@ -203,7 +203,7 @@ WebInspector.InspectorBackendStub.prototype = {
         WebInspector.didGetScriptSource(callId, null);
     },
 
-    resumeDebugger: function()
+    resume: function()
     {
     },
 
@@ -243,15 +243,15 @@ WebInspector.InspectorBackendStub.prototype = {
         return [];
     },
 
-    stepIntoStatementInDebugger: function()
+    stepIntoStatement: function()
     {
     },
 
-    stepOutOfFunctionInDebugger: function()
+    stepOutOfFunction: function()
     {
     },
 
-    stepOverStatementInDebugger: function()
+    stepOverStatement: function()
     {
     },
 
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index 8fbc913..41396f4 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -927,11 +927,11 @@ WebInspector.ScriptsPanel.prototype = {
         if (this._paused) {
             this._paused = false;
             this._waitingToPause = false;
-            InspectorBackend.resumeDebugger();
+            InspectorBackend.resume();
         } else {
             this._stepping = false;
             this._waitingToPause = true;
-            InspectorBackend.pauseInDebugger();
+            InspectorBackend.pause();
         }
 
         this._clearInterface();
@@ -944,7 +944,7 @@ WebInspector.ScriptsPanel.prototype = {
 
         this._clearInterface();
 
-        InspectorBackend.stepOverStatementInDebugger();
+        InspectorBackend.stepOverStatement();
     },
 
     _stepIntoClicked: function()
@@ -954,7 +954,7 @@ WebInspector.ScriptsPanel.prototype = {
 
         this._clearInterface();
 
-        InspectorBackend.stepIntoStatementInDebugger();
+        InspectorBackend.stepIntoStatement();
     },
 
     _stepOutClicked: function()
@@ -964,7 +964,7 @@ WebInspector.ScriptsPanel.prototype = {
 
         this._clearInterface();
 
-        InspectorBackend.stepOutOfFunctionInDebugger();
+        InspectorBackend.stepOutOfFunction();
     },
 
     toggleBreakpointsClicked: function()
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index 1860f0c..aee8af4 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -2996,7 +2996,7 @@ void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest&, Pass
 #if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR) && USE(JSC)
     if (Page* page = m_frame->page()) {
         if (page->mainFrame() == m_frame)
-            page->inspectorController()->resumeDebugger();
+            page->inspectorController()->resume();
     }
 #endif
 
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 850df04..24b6448 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,22 @@
+2010-07-14  Ilya Tikhonovsky  <loislo at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        WebInspector: Clean-up InspectorBackend code. In the next changes
+        InspectorBackend content will be generated by scripts. As far as
+        generator is very simple thing all nontrivial function should be
+        moved to InspectorController and DOMAgent.
+        https://bugs.webkit.org/show_bug.cgi?id=42171
+
+        * src/js/InspectorControllerImpl.js:
+        (devtools.InspectorBackendImpl):
+        (.devtools.InspectorBackendImpl.prototype.pause):
+        (.devtools.InspectorBackendImpl.prototype.resume):
+        (.devtools.InspectorBackendImpl.prototype.stepIntoStatement):
+        (.devtools.InspectorBackendImpl.prototype.stepOutOfFunction):
+        (.devtools.InspectorBackendImpl.prototype.stepOverStatement):
+        (else.devtools.InspectorBackendImpl.prototype.pause):
+
 2010-07-14  Pavel Podivilov  <podivilov at chromium.org>
 
         Reviewed by Yury Semikhatsky.
diff --git a/WebKit/chromium/src/js/InspectorControllerImpl.js b/WebKit/chromium/src/js/InspectorControllerImpl.js
index cbe607d..caa0d81 100644
--- a/WebKit/chromium/src/js/InspectorControllerImpl.js
+++ b/WebKit/chromium/src/js/InspectorControllerImpl.js
@@ -111,10 +111,10 @@ devtools.InspectorBackendImpl = function()
     this.installInspectorControllerDelegate_("removeBreakpoint");
     this.installInspectorControllerDelegate_("activateBreakpoints");
     this.installInspectorControllerDelegate_("deactivateBreakpoints");
-    this.installInspectorControllerDelegate_("resumeDebugger");
-    this.installInspectorControllerDelegate_("stepIntoStatementInDebugger");
-    this.installInspectorControllerDelegate_("stepOutOfFunctionInDebugger");
-    this.installInspectorControllerDelegate_("stepOverStatementInDebugger");
+    this.installInspectorControllerDelegate_("resume");
+    this.installInspectorControllerDelegate_("stepIntoStatement");
+    this.installInspectorControllerDelegate_("stepOutOfFunction");
+    this.installInspectorControllerDelegate_("stepOverStatement");
     this.installInspectorControllerDelegate_("setPauseOnExceptionsState");
     }
 };
@@ -166,31 +166,31 @@ devtools.InspectorBackendImpl.prototype.deactivateBreakpoints = function()
 };
 
 
-devtools.InspectorBackendImpl.prototype.pauseInDebugger = function()
+devtools.InspectorBackendImpl.prototype.pause = function()
 {
     devtools.tools.getDebuggerAgent().pauseExecution();
 };
 
 
-devtools.InspectorBackendImpl.prototype.resumeDebugger = function()
+devtools.InspectorBackendImpl.prototype.resume = function()
 {
     devtools.tools.getDebuggerAgent().resumeExecution();
 };
 
 
-devtools.InspectorBackendImpl.prototype.stepIntoStatementInDebugger = function()
+devtools.InspectorBackendImpl.prototype.stepIntoStatement = function()
 {
     devtools.tools.getDebuggerAgent().stepIntoStatement();
 };
 
 
-devtools.InspectorBackendImpl.prototype.stepOutOfFunctionInDebugger = function()
+devtools.InspectorBackendImpl.prototype.stepOutOfFunction = function()
 {
     devtools.tools.getDebuggerAgent().stepOutOfFunction();
 };
 
 
-devtools.InspectorBackendImpl.prototype.stepOverStatementInDebugger = function()
+devtools.InspectorBackendImpl.prototype.stepOverStatement = function()
 {
     devtools.tools.getDebuggerAgent().stepOverStatement();
 };
@@ -227,7 +227,7 @@ devtools.InspectorBackendImpl.prototype.setPauseOnExceptions = function(value)
 
 } else {
 
-devtools.InspectorBackendImpl.prototype.pauseInDebugger = function()
+devtools.InspectorBackendImpl.prototype.pause = function()
 {
     RemoteDebuggerCommandExecutor.DebuggerPauseScript();
 };

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list