[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

pfeldman at chromium.org pfeldman at chromium.org
Sun Feb 20 23:17:05 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit c4776e30cdada14db13ac1a54c6bbfcf5621ce36
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 19 18:27:55 2011 +0000

    2011-01-19  Pavel Feldman  <pfeldman at 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):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76136 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt
index 765e413..a9e9fab 100644
--- a/Source/WebCore/CMakeLists.txt
+++ b/Source/WebCore/CMakeLists.txt
@@ -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
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index e5ed04e..fbca136 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,67 @@
+2011-01-19  Pavel Feldman  <pfeldman at 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 at chromium.org>
 
         Reviewed by Yury Semikhatsky.
diff --git a/Source/WebCore/GNUmakefile.am b/Source/WebCore/GNUmakefile.am
index 247f880..935f77e 100644
--- a/Source/WebCore/GNUmakefile.am
+++ b/Source/WebCore/GNUmakefile.am
@@ -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 \
diff --git a/Source/WebCore/WebCore.gypi b/Source/WebCore/WebCore.gypi
index ba01584..d293614 100644
--- a/Source/WebCore/WebCore.gypi
+++ b/Source/WebCore/WebCore.gypi
@@ -2035,6 +2035,8 @@
             'inspector/InspectorProfilerAgent.h',
             'inspector/InspectorResourceAgent.cpp',
             'inspector/InspectorResourceAgent.h',
+            'inspector/InspectorRuntimeAgent.cpp',
+            'inspector/InspectorRuntimeAgent.h',
             'inspector/InspectorState.cpp',
             'inspector/InspectorSettings.h',
             'inspector/InspectorSettings.cpp',
diff --git a/Source/WebCore/WebCore.pro b/Source/WebCore/WebCore.pro
index be1718e..eef7e00 100644
--- a/Source/WebCore/WebCore.pro
+++ b/Source/WebCore/WebCore.pro
@@ -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 \
diff --git a/Source/WebCore/WebCore.vcproj/WebCore.vcproj b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
index 2a4ce1e..436e0fb 100755
--- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -65162,6 +65162,14 @@
 				>
 			</File>
 			<File
+				RelativePath="..\inspector\InspectorRuntimeAgent.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\inspector\InspectorRuntimeAgent.h"
+				>
+			</File>
+			<File
 				RelativePath="..\inspector\InspectorSettings.cpp"
 				>
 			</File>
diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
index df01534..a6ec711 100644
--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -1664,9 +1664,11 @@
 		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, ); }; };
@@ -8089,9 +8091,11 @@
 		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>"; };
@@ -12982,6 +12986,8 @@
 				9F0D6B2D121BFEBA006C0288 /* InspectorProfilerAgent.h */,
 				82AB1771125C826700C5069D /* InspectorResourceAgent.cpp */,
 				82AB1772125C826700C5069D /* InspectorResourceAgent.h */,
+				7AA365ED12E7265400DCA242 /* InspectorRuntimeAgent.cpp */,
+				7AF11A5912E727490061F23C /* InspectorRuntimeAgent.h */,
 				4FA3B908125CD12100300BAD /* InspectorState.cpp */,
 				4FA3B909125CD12200300BAD /* InspectorState.h */,
 				82AB176F125C826700C5069D /* InspectorStyleSheet.cpp */,
@@ -22367,6 +22373,7 @@
 				2E37E00612DBC5A400A6B233 /* JSDOMURL.h in Headers */,
 				7A5640C012DF9E5E00F4536D /* InspectorSettings.h in Headers */,
 				F3D4C47912E07663003DA150 /* InspectorBrowserDebuggerAgent.h in Headers */,
+				7AF11A5A12E727490061F23C /* InspectorRuntimeAgent.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -25056,6 +25063,7 @@
 				2E37E00512DBC5A400A6B233 /* JSDOMURL.cpp in Sources */,
 				7A5640BF12DF9E5E00F4536D /* InspectorSettings.cpp in Sources */,
 				F3D4C47812E07663003DA150 /* InspectorBrowserDebuggerAgent.cpp in Sources */,
+				7AA365EE12E7265400DCA242 /* InspectorRuntimeAgent.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/Source/WebCore/inspector/CodeGeneratorInspector.pm b/Source/WebCore/inspector/CodeGeneratorInspector.pm
index 16a6070..ea98d09 100644
--- a/Source/WebCore/inspector/CodeGeneratorInspector.pm
+++ b/Source/WebCore/inspector/CodeGeneratorInspector.pm
@@ -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"
diff --git a/Source/WebCore/inspector/InjectedScript.cpp b/Source/WebCore/inspector/InjectedScript.cpp
index f284627..1969f34 100644
--- a/Source/WebCore/inspector/InjectedScript.cpp
+++ b/Source/WebCore/inspector/InjectedScript.cpp
@@ -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);
 }
 
diff --git a/Source/WebCore/inspector/InjectedScript.h b/Source/WebCore/inspector/InjectedScript.h
index 9fb4c50..0a3f24b 100644
--- a/Source/WebCore/inspector/InjectedScript.h
+++ b/Source/WebCore/inspector/InjectedScript.h
@@ -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);
diff --git a/Source/WebCore/inspector/InjectedScriptHost.cpp b/Source/WebCore/inspector/InjectedScriptHost.cpp
index f23d8ec..be5b121 100644
--- a/Source/WebCore/inspector/InjectedScriptHost.cpp
+++ b/Source/WebCore/inspector/InjectedScriptHost.cpp
@@ -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)
diff --git a/Source/WebCore/inspector/InjectedScriptHost.h b/Source/WebCore/inspector/InjectedScriptHost.h
index 4cb622d..108f118 100644
--- a/Source/WebCore/inspector/InjectedScriptHost.h
+++ b/Source/WebCore/inspector/InjectedScriptHost.h
@@ -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;
diff --git a/Source/WebCore/inspector/InjectedScriptSource.js b/Source/WebCore/inspector/InjectedScriptSource.js
index 4683997..3aa24a6 100644
--- a/Source/WebCore/inspector/InjectedScriptSource.js
+++ b/Source/WebCore/inspector/InjectedScriptSource.js
@@ -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 = {
diff --git a/Source/WebCore/inspector/Inspector.idl b/Source/WebCore/inspector/Inspector.idl
index 739c336..0dba51a 100644
--- a/Source/WebCore/inspector/Inspector.idl
+++ b/Source/WebCore/inspector/Inspector.idl
@@ -71,19 +71,19 @@ module core {
         [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
diff --git a/Source/WebCore/inspector/InspectorController.cpp b/Source/WebCore/inspector/InspectorController.cpp
index 380c057..8b6b6bf 100644
--- a/Source/WebCore/inspector/InspectorController.cpp
+++ b/Source/WebCore/inspector/InspectorController.cpp
@@ -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);
diff --git a/Source/WebCore/inspector/InspectorController.h b/Source/WebCore/inspector/InspectorController.h
index 405139c..ab8377d 100644
--- a/Source/WebCore/inspector/InspectorController.h
+++ b/Source/WebCore/inspector/InspectorController.h
@@ -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;
diff --git a/Source/WebCore/inspector/InspectorDOMAgent.cpp b/Source/WebCore/inspector/InspectorDOMAgent.cpp
index 19ae30d..6e10f09 100644
--- a/Source/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/Source/WebCore/inspector/InspectorDOMAgent.cpp
@@ -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)
diff --git a/Source/WebCore/inspector/InspectorDOMAgent.h b/Source/WebCore/inspector/InspectorDOMAgent.h
index 97175fe..e4edf5d 100644
--- a/Source/WebCore/inspector/InspectorDOMAgent.h
+++ b/Source/WebCore/inspector/InspectorDOMAgent.h
@@ -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"
@@ -45,164 +47,168 @@
 #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
 
diff --git a/Source/WebCore/inspector/InspectorDebuggerAgent.cpp b/Source/WebCore/inspector/InspectorDebuggerAgent.cpp
index 5751363..acfbb6e 100644
--- a/Source/WebCore/inspector/InspectorDebuggerAgent.cpp
+++ b/Source/WebCore/inspector/InspectorDebuggerAgent.cpp
@@ -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();
diff --git a/Source/WebCore/inspector/InspectorDebuggerAgent.h b/Source/WebCore/inspector/InspectorDebuggerAgent.h
index 0a6fd3b..98ac1f9 100644
--- a/Source/WebCore/inspector/InspectorDebuggerAgent.h
+++ b/Source/WebCore/inspector/InspectorDebuggerAgent.h
@@ -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
index 0000000..61eb659
--- /dev/null
+++ b/Source/WebCore/inspector/InspectorRuntimeAgent.cpp
@@ -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
index 0000000..a13eb59
--- /dev/null
+++ b/Source/WebCore/inspector/InspectorRuntimeAgent.h
@@ -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
diff --git a/Source/WebCore/inspector/front-end/ConsoleView.js b/Source/WebCore/inspector/front-end/ConsoleView.js
index 843c2b3..abc0842 100644
--- a/Source/WebCore/inspector/front-end/ConsoleView.js
+++ b/Source/WebCore/inspector/front-end/ConsoleView.js
@@ -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) {
diff --git a/Source/WebCore/inspector/front-end/ScriptsPanel.js b/Source/WebCore/inspector/front-end/ScriptsPanel.js
index 6af124b..3e1b14d 100644
--- a/Source/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/Source/WebCore/inspector/front-end/ScriptsPanel.js
@@ -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)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list