2011-01-19 Pavel Feldman <pfeldman@chromium.org>
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Jan 2011 18:27:55 +0000 (18:27 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Jan 2011 18:27:55 +0000 (18:27 +0000)
        Reviewed by Yury Semikhatsky.

        Web Inspector: move methods from InjectedScript domain into DOM,
        Runtime and Debugger domains. Introduce InspectorRuntimeAgent.
        https://bugs.webkit.org/show_bug.cgi?id=52717

        * CMakeLists.txt:
        * GNUmakefile.am:
        * WebCore.gypi:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * inspector/CodeGeneratorInspector.pm:
        * inspector/InjectedScript.cpp:
        (WebCore::InjectedScript::evaluateOnCallFrame):
        (WebCore::InjectedScript::getCompletions):
        (WebCore::InjectedScript::getCompletionsOnCallFrame):
        * inspector/InjectedScript.h:
        * inspector/InjectedScriptHost.cpp:
        (WebCore::InjectedScriptHost::injectedScriptForMainWorld):
        * inspector/InjectedScriptHost.h:
        * inspector/InjectedScriptSource.js:
        (.):
        ():
        * inspector/Inspector.idl:
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::connectFrontend):
        (WebCore::InspectorController::releaseFrontendLifetimeAgents):
        * inspector/InspectorController.h:
        * inspector/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::InspectorDOMAgent):
        (WebCore::InspectorDOMAgent::resolveNode):
        (WebCore::InspectorDOMAgent::getNodeProperties):
        (WebCore::InspectorDOMAgent::getNodePrototypes):
        (WebCore::InspectorDOMAgent::injectedScriptForNodeId):
        * inspector/InspectorDOMAgent.h:
        (WebCore::EventListenerInfo::EventListenerInfo):
        (WebCore::InspectorDOMAgent::DOMListener::~DOMListener):
        (WebCore::InspectorDOMAgent::create):
        (WebCore::InspectorDOMAgent::cast):
        (WebCore::InspectorDOMAgent::documents):
        * inspector/InspectorDebuggerAgent.cpp:
        (WebCore::InspectorDebuggerAgent::evaluateOnCallFrame):
        (WebCore::InspectorDebuggerAgent::getCompletionsOnCallFrame):
        (WebCore::InspectorDebuggerAgent::injectedScriptForCallFrameId):
        * inspector/InspectorDebuggerAgent.h:
        * inspector/InspectorRuntimeAgent.cpp: Added.
        (WebCore::InspectorRuntimeAgent::InspectorRuntimeAgent):
        (WebCore::InspectorRuntimeAgent::~InspectorRuntimeAgent):
        (WebCore::InspectorRuntimeAgent::evaluate):
        (WebCore::InspectorRuntimeAgent::getCompletions):
        (WebCore::InspectorRuntimeAgent::getProperties):
        (WebCore::InspectorRuntimeAgent::setPropertyValue):
        (WebCore::InspectorRuntimeAgent::pushNodeToFrontend):
        (WebCore::InspectorRuntimeAgent::injectedScriptForObjectId):
        * inspector/InspectorRuntimeAgent.h: Copied from Source/WebCore/inspector/InjectedScript.h.
        (WebCore::InspectorRuntimeAgent::create):
        * inspector/front-end/ConsoleView.js:
        (WebInspector.ConsoleView.prototype.completions):
        * inspector/front-end/ScriptsPanel.js:
        (WebInspector.ScriptsPanel.prototype.doEvalInCallFrame):

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

24 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.am
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.pro
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/inspector/CodeGeneratorInspector.pm
Source/WebCore/inspector/InjectedScript.cpp
Source/WebCore/inspector/InjectedScript.h
Source/WebCore/inspector/InjectedScriptHost.cpp
Source/WebCore/inspector/InjectedScriptHost.h
Source/WebCore/inspector/InjectedScriptSource.js
Source/WebCore/inspector/Inspector.idl
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorController.h
Source/WebCore/inspector/InspectorDOMAgent.cpp
Source/WebCore/inspector/InspectorDOMAgent.h
Source/WebCore/inspector/InspectorDebuggerAgent.cpp
Source/WebCore/inspector/InspectorDebuggerAgent.h
Source/WebCore/inspector/InspectorRuntimeAgent.cpp [new file with mode: 0644]
Source/WebCore/inspector/InspectorRuntimeAgent.h [new file with mode: 0644]
Source/WebCore/inspector/front-end/ConsoleView.js
Source/WebCore/inspector/front-end/ScriptsPanel.js

index 765e413b48031d60048552cd5b82ce52c66e3b0c..a9e9fab6ca4a0cb0804ad14d444e20b9a26b53ef 100644 (file)
@@ -1169,6 +1169,7 @@ SET(WebCore_SOURCES
     inspector/InspectorInstrumentation.cpp
     inspector/InspectorProfilerAgent.cpp
     inspector/InspectorResourceAgent.cpp
+    inspector/InspectorRuntimeAgent.cpp
     inspector/InspectorSettings.cpp
     inspector/InspectorState.cpp
     inspector/InspectorStyleSheet.cpp
index e5ed04ef2dde4a823d22883c110e91af72513708..fbca136ffac1d61133101ab57241f96b1540bb25 100644 (file)
@@ -1,3 +1,67 @@
+2011-01-19  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: move methods from InjectedScript domain into DOM,
+        Runtime and Debugger domains. Introduce InspectorRuntimeAgent.
+        https://bugs.webkit.org/show_bug.cgi?id=52717
+
+        * CMakeLists.txt:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * inspector/CodeGeneratorInspector.pm:
+        * inspector/InjectedScript.cpp:
+        (WebCore::InjectedScript::evaluateOnCallFrame):
+        (WebCore::InjectedScript::getCompletions):
+        (WebCore::InjectedScript::getCompletionsOnCallFrame):
+        * inspector/InjectedScript.h:
+        * inspector/InjectedScriptHost.cpp:
+        (WebCore::InjectedScriptHost::injectedScriptForMainWorld):
+        * inspector/InjectedScriptHost.h:
+        * inspector/InjectedScriptSource.js:
+        (.):
+        ():
+        * inspector/Inspector.idl:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::connectFrontend):
+        (WebCore::InspectorController::releaseFrontendLifetimeAgents):
+        * inspector/InspectorController.h:
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::InspectorDOMAgent):
+        (WebCore::InspectorDOMAgent::resolveNode):
+        (WebCore::InspectorDOMAgent::getNodeProperties):
+        (WebCore::InspectorDOMAgent::getNodePrototypes):
+        (WebCore::InspectorDOMAgent::injectedScriptForNodeId):
+        * inspector/InspectorDOMAgent.h:
+        (WebCore::EventListenerInfo::EventListenerInfo):
+        (WebCore::InspectorDOMAgent::DOMListener::~DOMListener):
+        (WebCore::InspectorDOMAgent::create):
+        (WebCore::InspectorDOMAgent::cast):
+        (WebCore::InspectorDOMAgent::documents):
+        * inspector/InspectorDebuggerAgent.cpp:
+        (WebCore::InspectorDebuggerAgent::evaluateOnCallFrame):
+        (WebCore::InspectorDebuggerAgent::getCompletionsOnCallFrame):
+        (WebCore::InspectorDebuggerAgent::injectedScriptForCallFrameId):
+        * inspector/InspectorDebuggerAgent.h:
+        * inspector/InspectorRuntimeAgent.cpp: Added.
+        (WebCore::InspectorRuntimeAgent::InspectorRuntimeAgent):
+        (WebCore::InspectorRuntimeAgent::~InspectorRuntimeAgent):
+        (WebCore::InspectorRuntimeAgent::evaluate):
+        (WebCore::InspectorRuntimeAgent::getCompletions):
+        (WebCore::InspectorRuntimeAgent::getProperties):
+        (WebCore::InspectorRuntimeAgent::setPropertyValue):
+        (WebCore::InspectorRuntimeAgent::pushNodeToFrontend):
+        (WebCore::InspectorRuntimeAgent::injectedScriptForObjectId):
+        * inspector/InspectorRuntimeAgent.h: Copied from Source/WebCore/inspector/InjectedScript.h.
+        (WebCore::InspectorRuntimeAgent::create):
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleView.prototype.completions):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype.doEvalInCallFrame):
+
 2011-01-18  Pavel Podivilov  <podivilov@chromium.org>
 
         Reviewed by Yury Semikhatsky.
index 247f88011cebf411b71b2330441b0ca76f9673a8..935f77e70fd17b5df44775d33faae35ec9cbb1ce 100644 (file)
@@ -1982,6 +1982,8 @@ webcore_sources += \
        Source/WebCore/inspector/InspectorProfilerAgent.h \
        Source/WebCore/inspector/InspectorResourceAgent.cpp \
        Source/WebCore/inspector/InspectorResourceAgent.h \
+       Source/WebCore/inspector/InspectorRuntimeAgent.cpp \
+       Source/WebCore/inspector/InspectorRuntimeAgent.h \
        Source/WebCore/inspector/InspectorSettings.cpp \
        Source/WebCore/inspector/InspectorSettings.h \
        Source/WebCore/inspector/InspectorState.cpp \
index ba01584b3cefc2f663ceede081183825b3f6af06..d2936148dd8d0fd510e0b183b8e55226807fa991 100644 (file)
             'inspector/InspectorProfilerAgent.h',
             'inspector/InspectorResourceAgent.cpp',
             'inspector/InspectorResourceAgent.h',
+            'inspector/InspectorRuntimeAgent.cpp',
+            'inspector/InspectorRuntimeAgent.h',
             'inspector/InspectorState.cpp',
             'inspector/InspectorSettings.h',
             'inspector/InspectorSettings.cpp',
index be1718edcd240380511f3ccfbff652a37611b83f..eef7e00f29b6ebbb57fdd7da41747fb2859b70a5 100644 (file)
@@ -1060,6 +1060,7 @@ SOURCES += \
     inspector/InspectorInstrumentation.cpp \
     inspector/InspectorProfilerAgent.cpp \
     inspector/InspectorResourceAgent.cpp \
+    inspector/InspectorRuntimeAgent.cpp \
     inspector/InspectorSettings.cpp \
     inspector/InspectorState.cpp \
     inspector/InspectorStyleSheet.cpp \
@@ -1956,6 +1957,7 @@ HEADERS += \
     inspector/InspectorInstrumentation.h \
     inspector/InspectorProfilerAgent.h \
     inspector/InspectorResourceAgent.h \
+    inspector/InspectorRuntimeAgent.h \
     inspector/InspectorSettings.h \
     inspector/InspectorState.h \
     inspector/InspectorStyleSheet.h \
index 2a4ce1e80a169478740863665cbea32a24a8e88c..436e0fbee15412fa0ae098ca26ee172d704bb8d7 100755 (executable)
                                RelativePath="..\inspector\InspectorResourceAgent.h"
                                >
                        </File>
+                       <File
+                               RelativePath="..\inspector\InspectorRuntimeAgent.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\inspector\InspectorRuntimeAgent.h"
+                               >
+                       </File>
                        <File
                                RelativePath="..\inspector\InspectorSettings.cpp"
                                >
index df01534cbc41203cddc02186212880b94ccd0439..a6ec7118c4c6f4bcd9d88ae69632355315ee87d9 100644 (file)
                7A74ECBA101839A600BF939E /* InspectorDOMStorageAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A74ECB8101839A500BF939E /* InspectorDOMStorageAgent.cpp */; };
                7A74ECBB101839A600BF939E /* InspectorDOMStorageAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A74ECB9101839A600BF939E /* InspectorDOMStorageAgent.h */; };
                7A74ECBD101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */; };
+               7AA365EE12E7265400DCA242 /* InspectorRuntimeAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AA365ED12E7265400DCA242 /* InspectorRuntimeAgent.cpp */; };
                7AB0B1C01211A62200A76940 /* InspectorDatabaseAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AB0B1BE1211A62200A76940 /* InspectorDatabaseAgent.cpp */; };
                7AB0B1C11211A62200A76940 /* InspectorDatabaseAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AB0B1BF1211A62200A76940 /* InspectorDatabaseAgent.h */; };
                7ADE722610CBBB9B006B3B3A /* ContextMenuProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ADE722510CBBB9B006B3B3A /* ContextMenuProvider.h */; };
+               7AF11A5A12E727490061F23C /* InspectorRuntimeAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AF11A5912E727490061F23C /* InspectorRuntimeAgent.h */; };
                7AFD4A8B1131C2760035B883 /* ScriptBreakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AFD4A8A1131C2760035B883 /* ScriptBreakpoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7AFD4FF4113277B60035B883 /* ScriptDebugListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AFD4FF3113277B60035B883 /* ScriptDebugListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7E33CD01127F340D00BE8F17 /* PurgePriority.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E33CD00127F340D00BE8F17 /* PurgePriority.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7A74ECB8101839A500BF939E /* InspectorDOMStorageAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDOMStorageAgent.cpp; sourceTree = "<group>"; };
                7A74ECB9101839A600BF939E /* InspectorDOMStorageAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDOMStorageAgent.h; sourceTree = "<group>"; };
                7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInspectorFrontendHostCustom.cpp; sourceTree = "<group>"; };
+               7AA365ED12E7265400DCA242 /* InspectorRuntimeAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorRuntimeAgent.cpp; sourceTree = "<group>"; };
                7AB0B1BE1211A62200A76940 /* InspectorDatabaseAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDatabaseAgent.cpp; sourceTree = "<group>"; };
                7AB0B1BF1211A62200A76940 /* InspectorDatabaseAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDatabaseAgent.h; sourceTree = "<group>"; };
                7ADE722510CBBB9B006B3B3A /* ContextMenuProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContextMenuProvider.h; sourceTree = "<group>"; };
+               7AF11A5912E727490061F23C /* InspectorRuntimeAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorRuntimeAgent.h; sourceTree = "<group>"; };
                7AFD4A8A1131C2760035B883 /* ScriptBreakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptBreakpoint.h; sourceTree = "<group>"; };
                7AFD4FF3113277B60035B883 /* ScriptDebugListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptDebugListener.h; sourceTree = "<group>"; };
                7E33CD00127F340D00BE8F17 /* PurgePriority.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PurgePriority.h; sourceTree = "<group>"; };
                                9F0D6B2D121BFEBA006C0288 /* InspectorProfilerAgent.h */,
                                82AB1771125C826700C5069D /* InspectorResourceAgent.cpp */,
                                82AB1772125C826700C5069D /* InspectorResourceAgent.h */,
+                               7AA365ED12E7265400DCA242 /* InspectorRuntimeAgent.cpp */,
+                               7AF11A5912E727490061F23C /* InspectorRuntimeAgent.h */,
                                4FA3B908125CD12100300BAD /* InspectorState.cpp */,
                                4FA3B909125CD12200300BAD /* InspectorState.h */,
                                82AB176F125C826700C5069D /* InspectorStyleSheet.cpp */,
                                2E37E00612DBC5A400A6B233 /* JSDOMURL.h in Headers */,
                                7A5640C012DF9E5E00F4536D /* InspectorSettings.h in Headers */,
                                F3D4C47912E07663003DA150 /* InspectorBrowserDebuggerAgent.h in Headers */,
+                               7AF11A5A12E727490061F23C /* InspectorRuntimeAgent.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                2E37E00512DBC5A400A6B233 /* JSDOMURL.cpp in Sources */,
                                7A5640BF12DF9E5E00F4536D /* InspectorSettings.cpp in Sources */,
                                F3D4C47812E07663003DA150 /* InspectorBrowserDebuggerAgent.cpp in Sources */,
+                               7AA365EE12E7265400DCA242 /* InspectorRuntimeAgent.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 16a6070b7f1ee56dd76c98b7781b5ad80aeda7e9..ea98d096819c4124ee5c4f742de3a64434acc6b5 100644 (file)
@@ -73,6 +73,11 @@ $typeTransform{"Profiler"} = {
     "header" => "InspectorProfilerAgent.h",
     "domainAccessor" => "m_inspectorController->m_profilerAgent",
 };
+$typeTransform{"Runtime"} = {
+    "forward" => "InspectorRuntimeAgent",
+    "header" => "InspectorRuntimeAgent.h",
+    "domainAccessor" => "m_inspectorController->m_runtimeAgent",
+};
 
 $typeTransform{"Frontend"} = {
     "forward" => "InspectorFrontend",
@@ -117,7 +122,7 @@ $typeTransform{"String"} = {
     "variable" => "String",
     "return" => "String",
     "defaultValue" => "\"\"",
-    "forwardHeader" => "wtf/Forward.h",
+    "forwardHeader" => "PlatformString.h",
     "header" => "PlatformString.h",
     "JSONType" => "String",
     "JSType" => "string"
index f28462720262b7f4b865204f760caed11f710c48..1969f3430e14566f7d14b2f069dfe3204fd8f9a2 100644 (file)
@@ -52,10 +52,10 @@ void InjectedScript::evaluate(const String& expression, const String& objectGrou
     makeCall(function, result);
 }
 
-void InjectedScript::evaluateInCallFrame(long callFrame, const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result)
+void InjectedScript::evaluateOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result)
 {
-    ScriptFunctionCall function(m_injectedScriptObject, "evaluateInCallFrame");
-    function.appendArgument(callFrame);
+    ScriptFunctionCall function(m_injectedScriptObject, "evaluateOnCallFrame");
+    function.appendArgument(callFrameId->toJSONString());
     function.appendArgument(expression);
     function.appendArgument(objectGroup);
     makeCall(function, result);
@@ -69,12 +69,20 @@ void InjectedScript::evaluateOnSelf(const String& functionBody, PassRefPtr<Inspe
     makeCall(function, result);
 }
 
-void InjectedScript::getCompletions(const String& expression, bool includeInspectorCommandLineAPI, long callFrameId, RefPtr<InspectorValue>* result)
+void InjectedScript::getCompletions(const String& expression, bool includeInspectorCommandLineAPI, RefPtr<InspectorValue>* result)
 {
     ScriptFunctionCall function(m_injectedScriptObject, "getCompletions");
     function.appendArgument(expression);
     function.appendArgument(includeInspectorCommandLineAPI);
-    function.appendArgument(callFrameId);
+    makeCall(function, result);
+}
+
+void InjectedScript::getCompletionsOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, bool includeInspectorCommandLineAPI, RefPtr<InspectorValue>* result)
+{
+    ScriptFunctionCall function(m_injectedScriptObject, "getCompletionsOnCallFrame");
+    function.appendArgument(callFrameId->toJSONString());
+    function.appendArgument(expression);
+    function.appendArgument(includeInspectorCommandLineAPI);
     makeCall(function, result);
 }
 
index 9fb4c5014e3ba91addfb437e79cffc12687d3c22..0a3f24b9c3a8cf999252a6c3d1ce2c14861b6c33 100644 (file)
@@ -51,9 +51,10 @@ public:
     bool hasNoValue() const { return m_injectedScriptObject.hasNoValue(); }
 
     void evaluate(const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result);
-    void evaluateInCallFrame(long callFrame, const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result);
+    void evaluateOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result);
     void evaluateOnSelf(const String& functionBody, PassRefPtr<InspectorArray> argumentsArray, RefPtr<InspectorValue>* result);
-    void getCompletions(const String& expression, bool includeInspectorCommandLineAPI, long callFrameId, RefPtr<InspectorValue>* result);
+    void getCompletions(const String& expression, bool includeInspectorCommandLineAPI, RefPtr<InspectorValue>* result);
+    void getCompletionsOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, bool includeInspectorCommandLineAPI, RefPtr<InspectorValue>* result);
     void getProperties(PassRefPtr<InspectorObject> objectId, bool ignoreHasOwnProperty, bool abbreviate, RefPtr<InspectorValue>* result);
     void pushNodeToFrontend(PassRefPtr<InspectorObject> objectId, RefPtr<InspectorValue>* result);
     void resolveNode(long nodeId, RefPtr<InspectorValue>* result);
index f23d8ec1d5a2bbf3824b2217cdfb1e5e0b449edd..be5b121e3351f589cedb10ba771adddf23bac42f 100644 (file)
@@ -80,76 +80,13 @@ InjectedScriptHost::~InjectedScriptHost()
 {
 }
 
-void InjectedScriptHost::evaluate(const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result)
-{
-    InjectedScript injectedScript = injectedScriptForMainWorld();
-    if (!injectedScript.hasNoValue())
-        injectedScript.evaluate(expression, objectGroup, result);
-}
-
-void InjectedScriptHost::evaluateInCallFrame(long injectedScriptId, long callFrame, const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result)
-{
-    InjectedScript injectedScript = injectedScriptId ? m_idToInjectedScript.get(injectedScriptId) : injectedScriptForMainWorld();
-    if (!injectedScript.hasNoValue())
-        injectedScript.evaluateInCallFrame(callFrame, expression, objectGroup, result);
-}
-
 void InjectedScriptHost::evaluateOnSelf(const String& functionBody, PassRefPtr<InspectorArray> argumentsArray, RefPtr<InspectorValue>* result)
 {
-    InjectedScript injectedScript = injectedScriptForMainWorld();
+    InjectedScript injectedScript = injectedScriptForMainFrame();
     if (!injectedScript.hasNoValue())
         injectedScript.evaluateOnSelf(functionBody, argumentsArray, result);
 }
 
-void InjectedScriptHost::getCompletions(long injectedScriptId, const String& expression, bool includeInspectorCommandLineAPI, long callFrameId, RefPtr<InspectorValue>* result)
-{
-    InjectedScript injectedScript = injectedScriptId ? m_idToInjectedScript.get(injectedScriptId) : injectedScriptForMainWorld();
-    if (!injectedScript.hasNoValue())
-        injectedScript.getCompletions(expression, includeInspectorCommandLineAPI, callFrameId, result);
-}
-
-void InjectedScriptHost::getProperties(PassRefPtr<InspectorObject> objectId, bool ignoreHasOwnProperty, bool abbreviate, RefPtr<InspectorValue>* result)
-{
-    InjectedScript injectedScript = injectedScriptForObjectId(objectId.get());
-    if (!injectedScript.hasNoValue())
-        injectedScript.getProperties(objectId, ignoreHasOwnProperty, abbreviate, result);
-}
-
-void InjectedScriptHost::pushNodeToFrontend(PassRefPtr<InspectorObject> objectId, RefPtr<InspectorValue>* result)
-{
-    InjectedScript injectedScript = injectedScriptForObjectId(objectId.get());
-    if (!injectedScript.hasNoValue())
-        injectedScript.pushNodeToFrontend(objectId, result);
-}
-
-void InjectedScriptHost::resolveNode(long nodeId, RefPtr<InspectorValue>* result)
-{
-    InjectedScript injectedScript = injectedScriptForNodeId(nodeId);
-    if (!injectedScript.hasNoValue())
-        injectedScript.resolveNode(nodeId, result);
-}
-
-void InjectedScriptHost::getNodeProperties(long nodeId, PassRefPtr<InspectorArray> propertiesArray, RefPtr<InspectorValue>* result)
-{
-    InjectedScript injectedScript = injectedScriptForNodeId(nodeId);
-    if (!injectedScript.hasNoValue())
-        injectedScript.getNodeProperties(nodeId, propertiesArray, result);
-}
-
-void InjectedScriptHost::getNodePrototypes(long nodeId, RefPtr<InspectorValue>* result)
-{
-    InjectedScript injectedScript = injectedScriptForNodeId(nodeId);
-    if (!injectedScript.hasNoValue())
-        injectedScript.getNodePrototypes(nodeId, result);
-}
-
-void InjectedScriptHost::setPropertyValue(PassRefPtr<InspectorObject> objectId, const String& propertyName, const String& expression, RefPtr<InspectorValue>* result)
-{
-    InjectedScript injectedScript = injectedScriptForObjectId(objectId.get());
-    if (!injectedScript.hasNoValue())
-        injectedScript.setPropertyValue(objectId, propertyName, expression, result);
-}
-
 void InjectedScriptHost::clearConsoleMessages()
 {
     if (m_inspectorController)
@@ -218,6 +155,20 @@ InjectedScript InjectedScriptHost::injectedScriptForId(long id)
     return m_idToInjectedScript.get(id);
 }
 
+InjectedScript InjectedScriptHost::injectedScriptForObjectId(InspectorObject* objectId)
+{
+    long injectedScriptId = 0;
+    bool success = objectId->getNumber("injectedScriptId", &injectedScriptId);
+    if (success)
+        return injectedScriptForId(injectedScriptId);
+    return InjectedScript();
+}
+
+InjectedScript InjectedScriptHost::injectedScriptForMainFrame()
+{
+    return injectedScriptFor(mainWorldScriptState(m_inspectorController->inspectedPage()->mainFrame()));
+}
+
 void InjectedScriptHost::discardInjectedScripts()
 {
     IdToInjectedScriptMap::iterator end = m_idToInjectedScript.end();
@@ -283,43 +234,6 @@ void InjectedScriptHost::didDestroyWorker(long id)
 }
 #endif // ENABLE(WORKERS)
 
-InjectedScript InjectedScriptHost::injectedScriptForObjectId(InspectorObject* objectId)
-{
-    long injectedScriptId = 0;
-    bool success = objectId->getNumber("injectedScriptId", &injectedScriptId);
-    if (success)
-        return m_idToInjectedScript.get(injectedScriptId);
-    return InjectedScript();
-}
-
-InjectedScript InjectedScriptHost::injectedScriptForNodeId(long nodeId)
-{
-    if (!m_inspectorController)
-        return InjectedScript();
-
-    Frame* frame = 0;
-    if (nodeId) {
-        ASSERT(m_inspectorController->domAgent());
-        Node* node = m_inspectorController->domAgent()->nodeForId(nodeId);
-        if (node) {
-            Document* document = node->ownerDocument();
-            if (document)
-                frame = document->frame();
-        }
-    } else
-        frame = m_inspectorController->inspectedPage()->mainFrame();
-
-    if (frame)
-        return injectedScriptFor(mainWorldScriptState(frame));
-
-    return InjectedScript();
-}
-
-InjectedScript InjectedScriptHost::injectedScriptForMainWorld()
-{
-    return injectedScriptFor(mainWorldScriptState(m_inspectorController->inspectedPage()->mainFrame()));
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)
index 4cb622da694450e4f59a1d516a53aa4038b7496d..108f118d9c0485b99933c7131bd3b60ef485b339 100644 (file)
@@ -44,6 +44,7 @@ class Database;
 class InjectedScript;
 class InspectorDOMAgent;
 class InspectorFrontend;
+class InspectorObject;
 class Node;
 class ScriptObject;
 class Storage;
@@ -59,16 +60,7 @@ public:
     ~InjectedScriptHost();
 
     // Part of the protocol.
-    void evaluate(const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result);
-    void evaluateInCallFrame(long injectedScriptId, long callFrame, const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result);
     void evaluateOnSelf(const String& functionBody, PassRefPtr<InspectorArray> argumentsArray, RefPtr<InspectorValue>* result);
-    void getCompletions(long injectedScriptId, const String& expression, bool includeInspectorCommandLineAPI, long callFrameId, RefPtr<InspectorValue>* result);
-    void getProperties(PassRefPtr<InspectorObject> objectId, bool ignoreHasOwnProperty, bool abbreviate, RefPtr<InspectorValue>* result);
-    void pushNodeToFrontend(PassRefPtr<InspectorObject> objectId, RefPtr<InspectorValue>* result);
-    void resolveNode(long nodeId, RefPtr<InspectorValue>* result);
-    void getNodeProperties(long nodeId, PassRefPtr<InspectorArray> propertiesArray, RefPtr<InspectorValue>* result);
-    void getNodePrototypes(long nodeId, RefPtr<InspectorValue>* result);
-    void setPropertyValue(PassRefPtr<InspectorObject> objectId, const String& propertyName, const String& expression, RefPtr<InspectorValue>* result);
 
     InspectorController* inspectorController() { return m_inspectorController; }
     void disconnectController() { m_inspectorController = 0; }
@@ -96,6 +88,8 @@ public:
     pair<long, ScriptObject> injectScript(const String& source, ScriptState*);
     InjectedScript injectedScriptFor(ScriptState*);
     InjectedScript injectedScriptForId(long);
+    InjectedScript injectedScriptForObjectId(InspectorObject* objectId);
+    InjectedScript injectedScriptForMainFrame();
     void discardInjectedScripts();
     void releaseWrapperObjectGroup(long injectedScriptId, const String& objectGroup);
 
@@ -109,10 +103,6 @@ private:
     ScriptObject createInjectedScript(const String& source, ScriptState* scriptState, long id);
     void discardInjectedScript(ScriptState*);
 
-    InjectedScript injectedScriptForObjectId(InspectorObject* objectId);
-    InjectedScript injectedScriptForNodeId(long nodeId);
-    InjectedScript injectedScriptForMainWorld();
-
     InspectorController* m_inspectorController;
     long m_nextInjectedScriptId;
     long m_lastWorkerId;
index 4683997b25638115dce884c688898f11beee7070..3aa24a6a2cb1be7a8086ab3a87dfe385e0af9017 100644 (file)
@@ -186,29 +186,14 @@ InjectedScript.prototype = {
         return Object.keys(propertyNameSet);
     },
 
-    getCompletions: function(expression, includeInspectorCommandLineAPI, callFrameId)
+    getCompletions: function(expression, includeInspectorCommandLineAPI)
     {
         var props = {};
         try {
-            var expressionResult;
-            // Evaluate on call frame if call frame id is available.
-            if (callFrameId !== -1) {
-                var callFrame = this._callFrameForId(callFrameId);
-                if (!callFrame)
-                    return props;
-                if (expression)
-                    expressionResult = this._evaluateOn(callFrame.evaluate, callFrame, expression, true);
-                else {
-                    // Evaluate into properties in scope of the selected call frame.
-                    var scopeChain = callFrame.scopeChain;
-                    for (var i = 0; i < scopeChain.length; ++i)
-                        this._populatePropertyNames(scopeChain[i], props);
-                }
-            } else {
-                if (!expression)
-                    expression = "this";
-                expressionResult = this._evaluateOn(inspectedWindow.eval, inspectedWindow, expression, false);
-            }
+            if (!expression)
+                expression = "this";
+            var expressionResult = this._evaluateOn(inspectedWindow.eval, inspectedWindow, expression, false);
+
             if (typeof expressionResult === "object")
                 this._populatePropertyNames(expressionResult, props);
     
@@ -221,6 +206,34 @@ InjectedScript.prototype = {
         return props;
     },
 
+    getCompletionsOnCallFrame: function(callFrameId, expression, includeInspectorCommandLineAPI)
+    {
+        var props = {};
+        try {
+            var callFrame = this._callFrameForId(callFrameId);
+            if (!callFrame)
+                return props;
+
+            if (expression) {
+                var expressionResult = this._evaluateOn(callFrame.evaluate, callFrame, expression, true);
+                if (typeof expressionResult === "object")
+                    this._populatePropertyNames(expressionResult, props);
+            } else {
+                // Evaluate into properties in scope of the selected call frame.
+                var scopeChain = callFrame.scopeChain;
+                for (var i = 0; i < scopeChain.length; ++i)
+                    this._populatePropertyNames(scopeChain[i], props);
+            }
+    
+            if (includeInspectorCommandLineAPI) {
+                for (var prop in this._commandLineAPI)
+                    props[prop] = true;
+            }
+        } catch(e) {
+        }
+        return props;
+    },
+
     evaluate: function(expression, objectGroup)
     {
         return this._evaluateAndWrap(inspectedWindow.eval, inspectedWindow, expression, objectGroup, false);
@@ -278,7 +291,7 @@ InjectedScript.prototype = {
         return result;
     },
 
-    evaluateInCallFrame: function(callFrameId, code, objectGroup)
+    evaluateOnCallFrame: function(callFrameId, code, objectGroup)
     {
         var callFrame = this._callFrameForId(callFrameId);
         if (!callFrame)
@@ -286,10 +299,12 @@ InjectedScript.prototype = {
         return this._evaluateAndWrap(callFrame.evaluate, callFrame, code, objectGroup, true);
     },
 
-    _callFrameForId: function(id)
+    _callFrameForId: function(callFrameId)
     {
+        var parsedCallFrameId = eval("(" + callFrameId + ")");
+        var ordinal = parsedCallFrameId.ordinal;
         var callFrame = InjectedScriptHost.currentCallFrame();
-        while (--id >= 0 && callFrame)
+        while (--ordinal >= 0 && callFrame)
             callFrame = callFrame.caller;
         return callFrame;
     },
@@ -531,16 +546,15 @@ InjectedScript.RemoteObject.fromObject = function(object, objectId, abbreviate)
     }
 }
 
-InjectedScript.CallFrameProxy = function(id, callFrame)
+InjectedScript.CallFrameProxy = function(ordinal, callFrame)
 {
-    this.id = id;
+    this.id = { ordinal: ordinal, injectedScriptId: injectedScriptId };
     this.type = callFrame.type;
     this.functionName = (this.type === "function" ? callFrame.functionName : "");
     this.sourceID = callFrame.sourceID;
     this.line = callFrame.line;
     this.column = callFrame.column;
     this.scopeChain = this._wrapScopeChain(callFrame);
-    this.worldId = injectedScriptId;
 }
 
 InjectedScript.CallFrameProxy.prototype = {
index 739c3365a97c7201e2728522d8cd0a935598b276..0dba51a2d4aa00206fff552d6246bf45b146c061 100644 (file)
@@ -70,20 +70,20 @@ module core {
         [domain=Inspector] void getCookies(out Array cookies, out String cookiesString);
         [domain=Inspector] void deleteCookie(in String cookieName, in String domain);
 
+        ///////////////////////////////////////////////////////////////////////
+        // Runtime
+        ///////////////////////////////////////////////////////////////////////
+
+        [domain=Runtime] void evaluate(in String expression, in String objectGroup, out Value result);
+        [domain=Runtime] void getCompletions(in String expression, in boolean includeInspectorCommandLineAPI, out Value result);
+        [domain=Runtime] void getProperties(in Object objectId, in boolean ignoreHasOwnProperty, in boolean abbreviate, out Value result);
+        [domain=Runtime] void setPropertyValue(in Object objectId, in String propertyName, in String expression, out Value result);
+
         ///////////////////////////////////////////////////////////////////////
         // Injected Script
         ///////////////////////////////////////////////////////////////////////
 
-        [domain=InjectedScript] void evaluate(in String expression, in String objectGroup, out Value result);
-        [domain=InjectedScript] void evaluateInCallFrame(in long injectedScriptId, in long callFrame, in String expression, in String objectGroup, out Value result);
         [domain=InjectedScript] void evaluateOnSelf(in String functionBody, in Array argumentsArray, out Value result);
-        [domain=InjectedScript] void getCompletions(in long injectedScriptId, in String expression, in boolean includeInspectorCommandLineAPI, in long callFrameId, out Value result);
-        [domain=InjectedScript] void getProperties(in Object objectId, in boolean ignoreHasOwnProperty, in boolean abbreviate, out Value result);
-        [domain=InjectedScript] void pushNodeToFrontend(in Object objectId, out Value result);
-        [domain=InjectedScript] void resolveNode(in long nodeId, out Value result);
-        [domain=InjectedScript] void getNodeProperties(in long nodeId, in Array propertiesArray, out Value result);
-        [domain=InjectedScript] void getNodePrototypes(in long nodeId, out Value result);
-        [domain=InjectedScript] void setPropertyValue(in Object objectId, in String propertyName, in String expression, out Value result);
 
         ///////////////////////////////////////////////////////////////////////
         // Console API
@@ -190,6 +190,10 @@ module core {
         [domain=DOM] void performSearch(in String query, in boolean runSynchronously);
         [domain=DOM] void searchCanceled();
         [domain=DOM] void pushNodeByPathToFrontend(in String path, out long nodeId);
+        [domain=DOM] void resolveNode(in long nodeId, out Value result);
+        [domain=DOM] void getNodeProperties(in long nodeId, in Array propertiesArray, out Value result);
+        [domain=DOM] void getNodePrototypes(in long nodeId, out Value result);
+        [domain=DOM] void pushNodeToFrontend(in Object objectId, out Value result);
 
         [notify, domain=DOM] void setDocument(out Value root); // FIXME: should be requested from the front-end as getDocument.
         [notify, domain=DOM] void attributesUpdated(out long id, out Array attributes);
@@ -266,11 +270,14 @@ module core {
         [domain=Debugger] void resume();
         [notify, domain=Debugger] void resumedScript(); // FIXME: Make this out parameter fo resume if possible.
 
-        [domain=Debugger] void setPauseOnExceptionsState(in long pauseOnExceptionsState, out long newState);
-
         [domain=Debugger] void editScriptSource(in String sourceID, in String newContent, out boolean success, out String result, out Value newCallFrames);
         [domain=Debugger] void getScriptSource(in String sourceID, out String scriptSource);
 
+        [domain=Debugger] void setPauseOnExceptionsState(in long pauseOnExceptionsState, out long newState);
+
+        [domain=Debugger] void evaluateOnCallFrame(in Object callFrameId, in String expression, in String objectGroup, out Value result);
+        [domain=Debugger] void getCompletionsOnCallFrame(in Object callFrameId, in String expression, in boolean includeInspectorCommandLineAPI, out Value result);
+
         [notify, domain=Debugger] void breakpointResolved(out String breakpointId, out String sourceID, out unsigned int lineNumber, out String condition, out boolean enabled, out unsigned int originalLineNumber);
 
 #if defined(ENABLE_WORKERS) && ENABLE_WORKERS
index 380c05760e5f0848d828321cf3378a80e504d60f..8b6b6bf7eb6e845bfc687250be1dbe4e85cf73af 100644 (file)
@@ -70,6 +70,7 @@
 #include "InspectorInstrumentation.h"
 #include "InspectorProfilerAgent.h"
 #include "InspectorResourceAgent.h"
+#include "InspectorRuntimeAgent.h"
 #include "InspectorSettings.h"
 #include "InspectorState.h"
 #include "InspectorTimelineAgent.h"
@@ -389,8 +390,9 @@ void InspectorController::connectFrontend()
     m_openingFrontend = false;
     releaseFrontendLifetimeAgents();
     m_frontend = new InspectorFrontend(m_client);
-    m_domAgent = InspectorDOMAgent::create(m_frontend.get());
+    m_domAgent = InspectorDOMAgent::create(m_injectedScriptHost.get(), m_frontend.get());
     m_resourceAgent = InspectorResourceAgent::create(m_inspectedPage, m_frontend.get());
+    m_runtimeAgent = InspectorRuntimeAgent::create(m_injectedScriptHost.get());
 
     m_cssAgent->setDOMAgent(m_domAgent.get());
 
@@ -500,6 +502,7 @@ void InspectorController::disconnectFrontend()
 void InspectorController::releaseFrontendLifetimeAgents()
 {
     m_resourceAgent.clear();
+    m_runtimeAgent.clear();
 
     // This should be invoked prior to m_domAgent destruction.
     m_cssAgent->setDOMAgent(0);
index 405139c3627462ebac231e1e22c4575e2c36d662..ab8377df1c2518643195cf6fe1874b9841ec6abb 100644 (file)
@@ -72,6 +72,7 @@ class InspectorFrontendClient;
 class InspectorObject;
 class InspectorProfilerAgent;
 class InspectorResourceAgent;
+class InspectorRuntimeAgent;
 class InspectorSettings;
 class InspectorState;
 class InspectorStorageAgent;
@@ -311,6 +312,7 @@ private:
 
     RefPtr<Node> m_nodeToFocus;
     RefPtr<InspectorResourceAgent> m_resourceAgent;
+    OwnPtr<InspectorRuntimeAgent> m_runtimeAgent;
 
 #if ENABLE(DATABASE)
     typedef HashMap<int, RefPtr<InspectorDatabaseResource> > DatabaseResourcesMap;
index 19ae30da7b95c49ef6cf3d1ed85c1144809a87c2..6e10f094d73e946f4e4300e8437ba617cac21259 100644 (file)
@@ -59,6 +59,7 @@
 #include "FrameTree.h"
 #include "HTMLElement.h"
 #include "HTMLFrameOwnerElement.h"
+#include "InjectedScriptHost.h"
 #include "InspectorFrontend.h"
 #include "MutationEvent.h"
 #include "Node.h"
@@ -206,8 +207,9 @@ public:
 
 }
 
-InspectorDOMAgent::InspectorDOMAgent(InspectorFrontend* frontend)
+InspectorDOMAgent::InspectorDOMAgent(InjectedScriptHost* injectedScriptHost, InspectorFrontend* frontend)
     : EventListener(InspectorDOMAgentType)
+    , m_injectedScriptHost(injectedScriptHost)
     , m_frontend(frontend)
     , m_domListener(0)
     , m_lastNodeId(1)
@@ -758,6 +760,34 @@ void InspectorDOMAgent::searchCanceled()
     m_searchResults.clear();
 }
 
+void InspectorDOMAgent::resolveNode(long nodeId, RefPtr<InspectorValue>* result)
+{
+    InjectedScript injectedScript = injectedScriptForNodeId(nodeId);
+    if (!injectedScript.hasNoValue())
+        injectedScript.resolveNode(nodeId, result);
+}
+
+void InspectorDOMAgent::getNodeProperties(long nodeId, PassRefPtr<InspectorArray> propertiesArray, RefPtr<InspectorValue>* result)
+{
+    InjectedScript injectedScript = injectedScriptForNodeId(nodeId);
+    if (!injectedScript.hasNoValue())
+        injectedScript.getNodeProperties(nodeId, propertiesArray, result);
+}
+
+void InspectorDOMAgent::getNodePrototypes(long nodeId, RefPtr<InspectorValue>* result)
+{
+    InjectedScript injectedScript = injectedScriptForNodeId(nodeId);
+    if (!injectedScript.hasNoValue())
+        injectedScript.getNodePrototypes(nodeId, result);
+}
+
+void InspectorDOMAgent::pushNodeToFrontend(PassRefPtr<InspectorObject> objectId, RefPtr<InspectorValue>* result)
+{
+    InjectedScript injectedScript = m_injectedScriptHost->injectedScriptForObjectId(objectId.get());
+    if (!injectedScript.hasNoValue())
+        injectedScript.pushNodeToFrontend(objectId, result);
+}
+
 String InspectorDOMAgent::documentURLString(Document* document) const
 {
     if (!document || document->url().isNull())
@@ -1112,6 +1142,26 @@ void InspectorDOMAgent::pushNodeByPathToFrontend(const String& path, long* nodeI
         *nodeId = pushNodePathToFrontend(node);
 }
 
+InjectedScript InspectorDOMAgent::injectedScriptForNodeId(long nodeId)
+{
+    Frame* frame = 0;
+    if (nodeId) {
+        Node* node = nodeForId(nodeId);
+        if (node) {
+            Document* document = node->ownerDocument();
+            if (document)
+                frame = document->frame();
+        }
+    } else
+        frame = mainFrameDocument()->frame();
+
+    if (frame)
+        return m_injectedScriptHost->injectedScriptFor(mainWorldScriptState(frame));
+
+    return InjectedScript();
+}
+
+
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)
index 97175fee462f1a50f627656de48d679300c304bd..e4edf5d46a8f3be8a18b6dcb0e341df8c6eaa9e6 100644 (file)
@@ -32,6 +32,8 @@
 
 #include "EventListener.h"
 #include "EventTarget.h"
+#include "InjectedScript.h"
+#include "InjectedScriptHost.h"
 #include "InspectorValues.h"
 #include "NodeList.h"
 #include "Timer.h"
 #include <wtf/text/AtomicString.h>
 
 namespace WebCore {
-    class ContainerNode;
-    class CSSRule;
-    class CSSRuleList;
-    class CSSStyleDeclaration;
-    class CSSStyleRule;
-    class CSSStyleSheet;
-    class CharacterData;
-    class Document;
-    class Element;
-    class Event;
-    class InspectorDOMAgent;
-    class InspectorFrontend;
-    class MatchJob;
-    class NameNodeMap;
-    class Node;
-    class Page;
+class ContainerNode;
+class CSSRule;
+class CSSRuleList;
+class CSSStyleDeclaration;
+class CSSStyleRule;
+class CSSStyleSheet;
+class CharacterData;
+class Document;
+class Element;
+class Event;
+class InspectorDOMAgent;
+class InspectorFrontend;
+class MatchJob;
+class NameNodeMap;
+class Node;
+class Page;
 
 #if ENABLE(INSPECTOR)
 
-    struct EventListenerInfo {
-        EventListenerInfo(Node* node, const AtomicString& eventType, const EventListenerVector& eventListenerVector)
-            : node(node)
-            , eventType(eventType)
-            , eventListenerVector(eventListenerVector)
+struct EventListenerInfo {
+    EventListenerInfo(Node* node, const AtomicString& eventType, const EventListenerVector& eventListenerVector)
+        : node(node)
+        , eventType(eventType)
+        , eventListenerVector(eventListenerVector)
+    {
+    }
+
+    Node* node;
+    const AtomicString eventType;
+    const EventListenerVector eventListenerVector;
+};
+
+class InspectorDOMAgent : public EventListener {
+public:
+    struct DOMListener {
+        virtual ~DOMListener()
         {
         }
-
-        Node* node;
-        const AtomicString eventType;
-        const EventListenerVector eventListenerVector;
-    };
-
-    class InspectorDOMAgent : public EventListener {
-    public:
-        struct DOMListener {
-            virtual ~DOMListener()
-            {
-            }
-            virtual void didRemoveDocument(Document*) = 0;
-            virtual void didRemoveDOMNode(Node*) = 0;
-            virtual void didModifyDOMAttr(Element*) = 0;
-        };
-
-        static PassRefPtr<InspectorDOMAgent> create(InspectorFrontend* frontend)
-        {
-            return adoptRef(new InspectorDOMAgent(frontend));
-        }
-
-        static const InspectorDOMAgent* cast(const EventListener* listener)
-        {
-            return listener->type() == InspectorDOMAgentType
-                ? static_cast<const InspectorDOMAgent*>(listener)
-                : 0;
-        }
-
-        InspectorDOMAgent(InspectorFrontend* frontend);
-        ~InspectorDOMAgent();
-
-        void reset();
-
-        virtual bool operator==(const EventListener& other);
-
-        // Methods called from the frontend for DOM nodes inspection.
-        void getChildNodes(long nodeId);
-        void setAttribute(long elementId, const String& name, const String& value, bool* success);
-        void removeAttribute(long elementId, const String& name, bool* success);
-        void removeNode(long nodeId, long* outNodeId);
-        void changeTagName(long nodeId, const String& tagName, long* newId);
-        void getOuterHTML(long nodeId, WTF::String* outerHTML);
-        void setOuterHTML(long nodeId, const String& outerHTML, long* newId);
-        void setTextNodeValue(long nodeId, const String& value, bool* success);
-        void getEventListenersForNode(long nodeId, long* outNodeId, RefPtr<InspectorArray>* listenersArray);
-        void addInspectedNode(long nodeId);
-        void performSearch(const String& whitespaceTrimmedQuery, bool runSynchronously);
-        void searchCanceled();
-        bool shouldBreakOnNodeInsertion(Node* node, Node* parent, PassRefPtr<InspectorObject> details);
-        bool shouldBreakOnNodeRemoval(Node* node, PassRefPtr<InspectorObject> details);
-        bool shouldBreakOnAttributeModification(Element* element, PassRefPtr<InspectorObject> details);
-
-        // Methods called from the InspectorInstrumentation.
-        void setDocument(Document* document);
-        void releaseDanglingNodes();
-
-        void didInsertDOMNode(Node*);
-        void didRemoveDOMNode(Node*);
-        void didModifyDOMAttr(Element*);
-        void characterDataModified(CharacterData*);
-
-        Node* nodeForId(long nodeId);
-        long pushNodePathToFrontend(Node* node);
-        void pushChildNodesToFrontend(long nodeId);
-        void pushNodeByPathToFrontend(const String& path, long* nodeId);
-        long inspectedNode(unsigned long num);
-        void copyNode(long nodeId);
-        const ListHashSet<RefPtr<Document> >& documents() { return m_documents; }
-        void setDOMListener(DOMListener*);
-
-        String documentURLString(Document* document) const;
-
-        // We represent embedded doms as a part of the same hierarchy. Hence we treat children of frame owners differently.
-        // We also skip whitespace text nodes conditionally. Following methods encapsulate these specifics.
-        static Node* innerFirstChild(Node*);
-        static Node* innerNextSibling(Node*);
-        static Node* innerPreviousSibling(Node*);
-        static unsigned innerChildNodeCount(Node*);
-        static Node* innerParentNode(Node*);
-        static bool isWhitespace(Node*);
-
-    private:
-        void startListeningFrameDocument(Node* frameOwnerNode);
-        void startListening(Document* document);
-        void stopListening(Document* document);
-
-        virtual void handleEvent(ScriptExecutionContext*, Event* event);
-
-        // Node-related methods.
-        typedef HashMap<RefPtr<Node>, long> NodeToIdMap;
-        long bind(Node* node, NodeToIdMap* nodesMap);
-        void unbind(Node* node, NodeToIdMap* nodesMap);
-
-        bool pushDocumentToFrontend();
-
-        bool hasBreakpoint(Node* node, long type);
-        void updateSubtreeBreakpoints(Node* root, uint32_t rootMask, bool value);
-        void descriptionForDOMEvent(Node* target, long breakpointType, bool insertion, PassRefPtr<InspectorObject> description);
-
-        PassRefPtr<InspectorObject> buildObjectForNode(Node* node, int depth, NodeToIdMap* nodesMap);
-        PassRefPtr<InspectorArray> buildArrayForElementAttributes(Element* element);
-        PassRefPtr<InspectorArray> buildArrayForContainerChildren(Node* container, int depth, NodeToIdMap* nodesMap);
-        PassRefPtr<InspectorObject> buildObjectForEventListener(const RegisteredEventListener& registeredEventListener, const AtomicString& eventType, Node* node);
-
-        Document* mainFrameDocument() const;
-
-        void onMatchJobsTimer(Timer<InspectorDOMAgent>*);
-        void reportNodesAsSearchResults(ListHashSet<Node*>& resultCollector);
-
-        Node* nodeForPath(const String& path);
-        PassRefPtr<InspectorArray> toArray(const Vector<String>& data);
-
-        void discardBindings();
-
-        InspectorFrontend* m_frontend;
-        DOMListener* m_domListener;
-        NodeToIdMap m_documentNodeToIdMap;
-        // Owns node mappings for dangling nodes.
-        Vector<NodeToIdMap*> m_danglingNodeToIdMaps;
-        HashMap<long, Node*> m_idToNode;
-        HashMap<long, NodeToIdMap*> m_idToNodesMap;
-        HashSet<long> m_childrenRequested;
-        long m_lastNodeId;
-        ListHashSet<RefPtr<Document> > m_documents;
-        Deque<MatchJob*> m_pendingMatchJobs;
-        Timer<InspectorDOMAgent> m_matchJobsTimer;
-        HashSet<RefPtr<Node> > m_searchResults;
-        Vector<long> m_inspectedNodes;
+        virtual void didRemoveDocument(Document*) = 0;
+        virtual void didRemoveDOMNode(Node*) = 0;
+        virtual void didModifyDOMAttr(Element*) = 0;
     };
 
-#endif
+    static PassRefPtr<InspectorDOMAgent> create(InjectedScriptHost* injectedScriptHost, InspectorFrontend* frontend)
+    {
+        return adoptRef(new InspectorDOMAgent(injectedScriptHost, frontend));
+    }
+
+    static const InspectorDOMAgent* cast(const EventListener* listener)
+    {
+        return listener->type() == InspectorDOMAgentType
+            ? static_cast<const InspectorDOMAgent*>(listener)
+            : 0;
+    }
+
+    InspectorDOMAgent(InjectedScriptHost*, InspectorFrontend*);
+    ~InspectorDOMAgent();
+
+    void reset();
+
+    virtual bool operator==(const EventListener& other);
+
+    // Methods called from the frontend for DOM nodes inspection.
+    void getChildNodes(long nodeId);
+    void setAttribute(long elementId, const String& name, const String& value, bool* success);
+    void removeAttribute(long elementId, const String& name, bool* success);
+    void removeNode(long nodeId, long* outNodeId);
+    void changeTagName(long nodeId, const String& tagName, long* newId);
+    void getOuterHTML(long nodeId, WTF::String* outerHTML);
+    void setOuterHTML(long nodeId, const String& outerHTML, long* newId);
+    void setTextNodeValue(long nodeId, const String& value, bool* success);
+    void getEventListenersForNode(long nodeId, long* outNodeId, RefPtr<InspectorArray>* listenersArray);
+    void addInspectedNode(long nodeId);
+    void performSearch(const String& whitespaceTrimmedQuery, bool runSynchronously);
+    void searchCanceled();
+    void resolveNode(long nodeId, RefPtr<InspectorValue>* result);
+    void getNodeProperties(long nodeId, PassRefPtr<InspectorArray> propertiesArray, RefPtr<InspectorValue>* result);
+    void getNodePrototypes(long nodeId, RefPtr<InspectorValue>* result);
+    void pushNodeToFrontend(PassRefPtr<InspectorObject> objectId, RefPtr<InspectorValue>* result);
+
+    // Methods called from the InspectorInstrumentation.
+    void setDocument(Document*);
+    void releaseDanglingNodes();
+
+    void didInsertDOMNode(Node*);
+    void didRemoveDOMNode(Node*);
+    void didModifyDOMAttr(Element*);
+    void characterDataModified(CharacterData*);
+
+    Node* nodeForId(long nodeId);
+    long pushNodePathToFrontend(Node*);
+    void pushChildNodesToFrontend(long nodeId);
+    void pushNodeByPathToFrontend(const String& path, long* nodeId);
+    long inspectedNode(unsigned long num);
+    void copyNode(long nodeId);
+    const ListHashSet<RefPtr<Document> >& documents() { return m_documents; }
+    void setDOMListener(DOMListener*);
+
+    String documentURLString(Document*) const;
+
+    // We represent embedded doms as a part of the same hierarchy. Hence we treat children of frame owners differently.
+    // We also skip whitespace text nodes conditionally. Following methods encapsulate these specifics.
+    static Node* innerFirstChild(Node*);
+    static Node* innerNextSibling(Node*);
+    static Node* innerPreviousSibling(Node*);
+    static unsigned innerChildNodeCount(Node*);
+    static Node* innerParentNode(Node*);
+    static bool isWhitespace(Node*);
+
+private:
+    void startListeningFrameDocument(Node* frameOwnerNode);
+    void startListening(Document*);
+    void stopListening(Document*);
+
+    virtual void handleEvent(ScriptExecutionContext*, Event*);
+
+    // Node-related methods.
+    typedef HashMap<RefPtr<Node>, long> NodeToIdMap;
+    long bind(Node*, NodeToIdMap*);
+    void unbind(Node*, NodeToIdMap*);
+
+    bool pushDocumentToFrontend();
+
+    bool hasBreakpoint(Node*, long type);
+    void updateSubtreeBreakpoints(Node* root, uint32_t rootMask, bool value);
+    void descriptionForDOMEvent(Node* target, long breakpointType, bool insertion, PassRefPtr<InspectorObject> description);
+
+    PassRefPtr<InspectorObject> buildObjectForNode(Node*, int depth, NodeToIdMap*);
+    PassRefPtr<InspectorArray> buildArrayForElementAttributes(Element*);
+    PassRefPtr<InspectorArray> buildArrayForContainerChildren(Node* container, int depth, NodeToIdMap* nodesMap);
+    PassRefPtr<InspectorObject> buildObjectForEventListener(const RegisteredEventListener&, const AtomicString& eventType, Node*);
+
+    Document* mainFrameDocument() const;
+
+    void onMatchJobsTimer(Timer<InspectorDOMAgent>*);
+    void reportNodesAsSearchResults(ListHashSet<Node*>& resultCollector);
+
+    Node* nodeForPath(const String& path);
+    PassRefPtr<InspectorArray> toArray(const Vector<String>& data);
+
+    void discardBindings();
+
+    InjectedScript injectedScriptForNodeId(long nodeId);
+
+    InjectedScriptHost* m_injectedScriptHost;
+    InspectorFrontend* m_frontend;
+    DOMListener* m_domListener;
+    NodeToIdMap m_documentNodeToIdMap;
+    // Owns node mappings for dangling nodes.
+    Vector<NodeToIdMap*> m_danglingNodeToIdMaps;
+    HashMap<long, Node*> m_idToNode;
+    HashMap<long, NodeToIdMap*> m_idToNodesMap;
+    HashSet<long> m_childrenRequested;
+    long m_lastNodeId;
+    ListHashSet<RefPtr<Document> > m_documents;
+    Deque<MatchJob*> m_pendingMatchJobs;
+    Timer<InspectorDOMAgent> m_matchJobsTimer;
+    HashSet<RefPtr<Node> > m_searchResults;
+    Vector<long> m_inspectedNodes;
+};
+
+#endif // ENABLE(INSPECTOR)
 
 } // namespace WebCore
 
index 5751363fd13f8d2746e47a964d5a2cbf4d631257..acfbb6e50a5c531b34aef561812187509476e92e 100644 (file)
@@ -173,6 +173,20 @@ void InspectorDebuggerAgent::setPauseOnExceptionsState(long pauseState, long* ne
     *newState = ScriptDebugServer::shared().pauseOnExceptionsState();
 }
 
+void InspectorDebuggerAgent::evaluateOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result)
+{
+    InjectedScript injectedScript = m_inspectorController->injectedScriptHost()->injectedScriptForObjectId(callFrameId.get());
+    if (!injectedScript.hasNoValue())
+        injectedScript.evaluateOnCallFrame(callFrameId, expression, objectGroup, result);
+}
+
+void InspectorDebuggerAgent::getCompletionsOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, bool includeInspectorCommandLineAPI, RefPtr<InspectorValue>* result)
+{
+    InjectedScript injectedScript = m_inspectorController->injectedScriptHost()->injectedScriptForObjectId(callFrameId.get());
+    if (!injectedScript.hasNoValue())
+        injectedScript.getCompletionsOnCallFrame(callFrameId, expression, includeInspectorCommandLineAPI, result);
+}
+
 void InspectorDebuggerAgent::clearForPageNavigation()
 {
     m_scriptIDToContent.clear();
index 0a6fd3b4afa4e0f2fddb448f884948344e0aa79e..98ac1f9a272e3703f83856dad767312748a2ddcc 100644 (file)
@@ -31,6 +31,7 @@
 #define InspectorDebuggerAgent_h
 
 #if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR)
+#include "InjectedScript.h"
 #include "ScriptDebugListener.h"
 #include "ScriptState.h"
 #include <wtf/Forward.h>
@@ -59,15 +60,14 @@ public:
 
     static bool isDebuggerAlwaysEnabled();
 
+    // Part of the protocol.
     void activateBreakpoints();
     void deactivateBreakpoints();
     void setStickyBreakpoint(const String& url, unsigned lineNumber, const String& condition, bool enabled);
     void setBreakpoint(const String& sourceID, unsigned lineNumber, const String& condition, bool enabled, String* breakpointId, unsigned int* actualLineNumber);
     void removeBreakpoint(const String& breakpointId);
-
     void editScriptSource(const String& sourceID, const String& newContent, bool* success, String* result, RefPtr<InspectorValue>* newCallFrames);
     void getScriptSource(const String& sourceID, String* scriptSource);
-
     void schedulePauseOnNextStatement(DebuggerEventType type, PassRefPtr<InspectorValue> data);
     void cancelPauseOnNextStatement();
     void breakProgram(DebuggerEventType type, PassRefPtr<InspectorValue> data);
@@ -76,8 +76,9 @@ public:
     void stepOver();
     void stepInto();
     void stepOut();
-
     void setPauseOnExceptionsState(long pauseState, long* newState);
+    void evaluateOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result);
+    void getCompletionsOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, bool includeInspectorCommandLineAPI, RefPtr<InspectorValue>* result);
 
     void clearForPageNavigation();
 
diff --git a/Source/WebCore/inspector/InspectorRuntimeAgent.cpp b/Source/WebCore/inspector/InspectorRuntimeAgent.cpp
new file mode 100644 (file)
index 0000000..61eb659
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InspectorRuntimeAgent.h"
+
+#if ENABLE(INSPECTOR)
+
+#include "InjectedScriptHost.h"
+#include "InspectorValues.h"
+
+namespace WebCore {
+
+InspectorRuntimeAgent::InspectorRuntimeAgent(InjectedScriptHost* injectedScriptHost)
+    : m_injectedScriptHost(injectedScriptHost)
+{
+}
+
+InspectorRuntimeAgent::~InspectorRuntimeAgent() { }
+
+void InspectorRuntimeAgent::evaluate(const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result)
+{
+    InjectedScript injectedScript = m_injectedScriptHost->injectedScriptForMainFrame();
+    if (!injectedScript.hasNoValue())
+        injectedScript.evaluate(expression, objectGroup, result);
+}
+
+void InspectorRuntimeAgent::getCompletions(const String& expression, bool includeInspectorCommandLineAPI, RefPtr<InspectorValue>* result)
+{
+    InjectedScript injectedScript = m_injectedScriptHost->injectedScriptForMainFrame();
+    if (!injectedScript.hasNoValue())
+        injectedScript.getCompletions(expression, includeInspectorCommandLineAPI, result);
+}
+
+void InspectorRuntimeAgent::getProperties(PassRefPtr<InspectorObject> objectId, bool ignoreHasOwnProperty, bool abbreviate, RefPtr<InspectorValue>* result)
+{
+    InjectedScript injectedScript = m_injectedScriptHost->injectedScriptForObjectId(objectId.get());
+    if (!injectedScript.hasNoValue())
+        injectedScript.getProperties(objectId, ignoreHasOwnProperty, abbreviate, result);
+}
+
+void InspectorRuntimeAgent::setPropertyValue(PassRefPtr<InspectorObject> objectId, const String& propertyName, const String& expression, RefPtr<InspectorValue>* result)
+{
+    InjectedScript injectedScript = m_injectedScriptHost->injectedScriptForObjectId(objectId.get());
+    if (!injectedScript.hasNoValue())
+        injectedScript.setPropertyValue(objectId, propertyName, expression, result);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INSPECTOR)
diff --git a/Source/WebCore/inspector/InspectorRuntimeAgent.h b/Source/WebCore/inspector/InspectorRuntimeAgent.h
new file mode 100644 (file)
index 0000000..a13eb59
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef InspectorRuntimeAgent_h
+#define InspectorRuntimeAgent_h
+
+#if ENABLE(INSPECTOR)
+
+#include "InjectedScript.h"
+#include "PlatformString.h"
+
+#include <wtf/Noncopyable.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+
+class InjectedScriptHost;
+class InspectorObject;
+class InspectorValue;
+
+class InspectorRuntimeAgent : public Noncopyable {
+public:
+    static PassOwnPtr<InspectorRuntimeAgent> create(InjectedScriptHost* injectedScriptHost)
+    {
+        return adoptPtr(new InspectorRuntimeAgent(injectedScriptHost));
+    }
+
+    ~InspectorRuntimeAgent();
+
+    // Part of the protocol.
+    void evaluate(const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result);
+    void getCompletions(const String& expression, bool includeInspectorCommandLineAPI, RefPtr<InspectorValue>* result);
+    void getProperties(PassRefPtr<InspectorObject> objectId, bool ignoreHasOwnProperty, bool abbreviate, RefPtr<InspectorValue>* result);
+    void setPropertyValue(PassRefPtr<InspectorObject> objectId, const String& propertyName, const String& expression, RefPtr<InspectorValue>* result);
+
+private:
+    InspectorRuntimeAgent(InjectedScriptHost*);
+
+    InjectedScriptHost* m_injectedScriptHost;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INSPECTOR)
+#endif // InspectorRuntimeAgent_h
index 843c2b39f6f78e22ef777b14c29a04c3fa76a773..abc0842aa732b1c3a7ed24da43993ea12a08047f 100644 (file)
@@ -355,14 +355,11 @@ WebInspector.ConsoleView.prototype = {
         // Collect comma separated object properties for the completion.
 
         var includeInspectorCommandLineAPI = (!dotNotation && !bracketNotation);
-        var callFrameId = WebInspector.panels.scripts.selectedCallFrameId() || -1;
         var injectedScriptAccess;
-        if (WebInspector.panels.scripts && WebInspector.panels.scripts.paused) {
-            var selectedCallFrame = WebInspector.panels.scripts.sidebarPanes.callstack.selectedCallFrame;
-            var injectedScriptId = selectedCallFrame.worldId;
-        } else
-            var injectedScriptId = 0;
-        InspectorBackend.getCompletions(injectedScriptId, expressionString, includeInspectorCommandLineAPI, callFrameId, reportCompletions);
+        if (WebInspector.panels.scripts && WebInspector.panels.scripts.paused)
+            InspectorBackend.getCompletionsOnCallFrame(WebInspector.panels.scripts.selectedCallFrameId(), expressionString, includeInspectorCommandLineAPI, reportCompletions);
+        else
+            InspectorBackend.getCompletions(expressionString, includeInspectorCommandLineAPI, reportCompletions);
     },
 
     _reportCompletions: function(bestMatchOnly, completionsReadyCallback, dotNotation, bracketNotation, prefix, result, isException) {
index 6af124bcae8fa4c821acad61e83ec7529fcb4a19..3e1b14d864ebe29e99af18cdd77faa890f9fd4ac 100644 (file)
@@ -366,7 +366,7 @@ WebInspector.ScriptsPanel.prototype = {
             if (result)
                 callback(WebInspector.RemoteObject.fromPayload(result));
         }
-        InspectorBackend.evaluateInCallFrame(callFrame.worldId, callFrame.id, code, objectGroup, evalCallback);
+        InspectorBackend.evaluateOnCallFrame(callFrame.id, code, objectGroup, evalCallback);
     },
 
     _debuggerPaused: function(event)