Index: Source/core/inspector/InspectorRuntimeAgent.cpp |
diff --git a/Source/core/inspector/InspectorRuntimeAgent.cpp b/Source/core/inspector/InspectorRuntimeAgent.cpp |
index a8d9f37076d3f109223e3e361fe7f0180d6338b7..873e48e7c37c53c56d100f913d9d9e5b1ed31f18 100644 |
--- a/Source/core/inspector/InspectorRuntimeAgent.cpp |
+++ b/Source/core/inspector/InspectorRuntimeAgent.cpp |
@@ -51,7 +51,7 @@ static bool asBool(const bool* const b) |
return b ? *b : false; |
} |
-InspectorRuntimeAgent::InspectorRuntimeAgent(InjectedScriptManager* injectedScriptManager, ScriptDebugServer* scriptDebugServer) |
+InspectorRuntimeAgent::InspectorRuntimeAgent(InjectedScriptManager* injectedScriptManager, ScriptDebugServerBase* scriptDebugServer) |
: InspectorBaseAgent<InspectorRuntimeAgent>("Runtime") |
, m_enabled(false) |
, m_frontend(0) |
@@ -64,7 +64,7 @@ InspectorRuntimeAgent::~InspectorRuntimeAgent() |
{ |
} |
-static ScriptDebugServer::PauseOnExceptionsState setPauseOnExceptionsState(ScriptDebugServer* scriptDebugServer, ScriptDebugServer::PauseOnExceptionsState newState) |
+static ScriptDebugServer::PauseOnExceptionsState setPauseOnExceptionsState(ScriptDebugServerBase* scriptDebugServer, ScriptDebugServer::PauseOnExceptionsState newState) |
{ |
ASSERT(scriptDebugServer); |
ScriptDebugServer::PauseOnExceptionsState presentState = scriptDebugServer->pauseOnExceptionsState(); |
@@ -75,7 +75,7 @@ static ScriptDebugServer::PauseOnExceptionsState setPauseOnExceptionsState(Scrip |
void InspectorRuntimeAgent::evaluate(ErrorString* errorString, const String& expression, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* const returnByValue, const bool* generatePreview, RefPtr<TypeBuilder::Runtime::RemoteObject>& result, TypeBuilder::OptOutput<bool>* wasThrown) |
{ |
- InjectedScript injectedScript = injectedScriptForEval(errorString, executionContextId); |
+ InjectedScript& injectedScript = injectedScriptForEval(errorString, executionContextId); |
if (injectedScript.isEmpty()) |
return; |
ScriptDebugServer::PauseOnExceptionsState previousPauseOnExceptionsState = ScriptDebugServer::DontPauseOnExceptions; |
@@ -94,7 +94,7 @@ void InspectorRuntimeAgent::evaluate(ErrorString* errorString, const String& exp |
void InspectorRuntimeAgent::callFunctionOn(ErrorString* errorString, const String& objectId, const String& expression, const RefPtr<JSONArray>* const optionalArguments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* generatePreview, RefPtr<TypeBuilder::Runtime::RemoteObject>& result, TypeBuilder::OptOutput<bool>* wasThrown) |
{ |
- InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId); |
+ InjectedScript& injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId); |
if (injectedScript.isEmpty()) { |
*errorString = "Inspected frame has gone"; |
return; |
@@ -117,9 +117,24 @@ void InspectorRuntimeAgent::callFunctionOn(ErrorString* errorString, const Strin |
} |
} |
+void InspectorRuntimeAgent::getCompletions(ErrorString* errorString, const String& expression, const int* executionContextId, RefPtr<TypeBuilder::Array<String> >& result) |
+{ |
+ InjectedScript& injectedScript = injectedScriptForEval(errorString, executionContextId); |
+ if (injectedScript.isEmpty()) |
+ return; |
+ |
+ ScriptDebugServer::PauseOnExceptionsState previousPauseOnExceptionsState = setPauseOnExceptionsState(m_scriptDebugServer, ScriptDebugServer::DontPauseOnExceptions); |
+ muteConsole(); |
+ |
+ injectedScript.getCompletions(errorString, expression, &result); |
+ |
+ unmuteConsole(); |
+ setPauseOnExceptionsState(m_scriptDebugServer, previousPauseOnExceptionsState); |
+} |
+ |
void InspectorRuntimeAgent::getProperties(ErrorString* errorString, const String& objectId, const bool* ownProperties, const bool* accessorPropertiesOnly, RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::PropertyDescriptor> >& result, RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::InternalPropertyDescriptor> >& internalProperties) |
{ |
- InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId); |
+ InjectedScript& injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId); |
if (injectedScript.isEmpty()) { |
*errorString = "Inspected frame has gone"; |
return; |
@@ -138,9 +153,26 @@ void InspectorRuntimeAgent::getProperties(ErrorString* errorString, const String |
setPauseOnExceptionsState(m_scriptDebugServer, previousPauseOnExceptionsState); |
} |
+void InspectorRuntimeAgent::getProperty(ErrorString* errorString, const String& objectId, const RefPtr<JSONArray>& propertyPath, RefPtr<TypeBuilder::Runtime::RemoteObject>& result, TypeBuilder::OptOutput<bool>* wasThrown) |
+{ |
+ InjectedScript& injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId); |
+ if (injectedScript.isEmpty()) { |
+ *errorString = "Inspected frame has gone"; |
+ return; |
+ } |
+ |
+ ScriptDebugServer::PauseOnExceptionsState previousPauseOnExceptionsState = setPauseOnExceptionsState(m_scriptDebugServer, ScriptDebugServer::DontPauseOnExceptions); |
+ muteConsole(); |
+ |
+ injectedScript.getProperty(errorString, objectId, propertyPath, &result, wasThrown); |
+ |
+ unmuteConsole(); |
+ setPauseOnExceptionsState(m_scriptDebugServer, previousPauseOnExceptionsState); |
+} |
+ |
void InspectorRuntimeAgent::releaseObject(ErrorString*, const String& objectId) |
{ |
- InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId); |
+ InjectedScript& injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId); |
if (!injectedScript.isEmpty()) |
injectedScript.releaseObject(objectId); |
} |