Index: third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp |
diff --git a/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp b/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp |
index b728a72aa61bfcf11a101f37cf1f68b29519772a..0ac2c29bfac07490ba79ecf59dd81c02f0f42f48 100644 |
--- a/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp |
+++ b/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp |
@@ -39,14 +39,13 @@ |
#include "platform/v8_inspector/RemoteObjectId.h" |
#include "platform/v8_inspector/V8Compat.h" |
#include "platform/v8_inspector/V8Console.h" |
-#include "platform/v8_inspector/V8DebuggerImpl.h" |
#include "platform/v8_inspector/V8FunctionCall.h" |
#include "platform/v8_inspector/V8InjectedScriptHost.h" |
+#include "platform/v8_inspector/V8InspectorImpl.h" |
#include "platform/v8_inspector/V8InspectorSessionImpl.h" |
#include "platform/v8_inspector/V8StackTraceImpl.h" |
#include "platform/v8_inspector/V8StringUtil.h" |
-#include "platform/v8_inspector/public/V8Debugger.h" |
-#include "platform/v8_inspector/public/V8DebuggerClient.h" |
+#include "platform/v8_inspector/public/V8InspectorClient.h" |
using blink::protocol::Array; |
using blink::protocol::Debugger::CallFrame; |
@@ -72,7 +71,7 @@ std::unique_ptr<InjectedScript> InjectedScript::create(InspectedContext* inspect |
v8::Context::Scope scope(context); |
std::unique_ptr<InjectedScriptNative> injectedScriptNative(new InjectedScriptNative(isolate)); |
- v8::Local<v8::Object> scriptHostWrapper = V8InjectedScriptHost::create(context, inspectedContext->debugger()); |
+ v8::Local<v8::Object> scriptHostWrapper = V8InjectedScriptHost::create(context, inspectedContext->inspector()); |
injectedScriptNative->setOnInjectedScriptHost(scriptHostWrapper); |
// Inject javascript into the context. The compiled script is supposed to evaluate into |
@@ -82,7 +81,7 @@ std::unique_ptr<InjectedScript> InjectedScript::create(InspectedContext* inspect |
// to create and configure InjectedScript instance that is going to be used by the inspector. |
String16 injectedScriptSource(reinterpret_cast<const char*>(InjectedScriptSource_js), sizeof(InjectedScriptSource_js)); |
v8::Local<v8::Value> value; |
- if (!inspectedContext->debugger()->compileAndRunInternalScript(context, toV8String(isolate, injectedScriptSource)).ToLocal(&value)) |
+ if (!inspectedContext->inspector()->compileAndRunInternalScript(context, toV8String(isolate, injectedScriptSource)).ToLocal(&value)) |
return nullptr; |
DCHECK(value->IsFunction()); |
v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(value); |
@@ -111,7 +110,7 @@ InjectedScript::~InjectedScript() |
void InjectedScript::getProperties(ErrorString* errorString, v8::Local<v8::Object> object, const String16& groupName, bool ownProperties, bool accessorPropertiesOnly, bool generatePreview, std::unique_ptr<Array<PropertyDescriptor>>* properties, Maybe<protocol::Runtime::ExceptionDetails>* exceptionDetails) |
{ |
v8::HandleScope handles(m_context->isolate()); |
- V8FunctionCall function(m_context->debugger(), m_context->context(), v8Value(), "getProperties"); |
+ V8FunctionCall function(m_context->inspector(), m_context->context(), v8Value(), "getProperties"); |
function.appendArgument(object); |
function.appendArgument(groupName); |
function.appendArgument(ownProperties); |
@@ -179,7 +178,7 @@ bool InjectedScript::wrapObjectProperty(ErrorString* errorString, v8::Local<v8:: |
bool InjectedScript::wrapPropertyInArray(ErrorString* errorString, v8::Local<v8::Array> array, v8::Local<v8::String> property, const String16& groupName, bool forceValueType, bool generatePreview) const |
{ |
- V8FunctionCall function(m_context->debugger(), m_context->context(), v8Value(), "wrapPropertyInArray"); |
+ V8FunctionCall function(m_context->inspector(), m_context->context(), v8Value(), "wrapPropertyInArray"); |
function.appendArgument(array); |
function.appendArgument(property); |
function.appendArgument(groupName); |
@@ -192,7 +191,7 @@ bool InjectedScript::wrapPropertyInArray(ErrorString* errorString, v8::Local<v8: |
bool InjectedScript::wrapObjectsInArray(ErrorString* errorString, v8::Local<v8::Array> array, const String16& groupName, bool forceValueType, bool generatePreview) const |
{ |
- V8FunctionCall function(m_context->debugger(), m_context->context(), v8Value(), "wrapObjectsInArray"); |
+ V8FunctionCall function(m_context->inspector(), m_context->context(), v8Value(), "wrapObjectsInArray"); |
function.appendArgument(array); |
function.appendArgument(groupName); |
function.appendArgument(forceValueType); |
@@ -204,7 +203,7 @@ bool InjectedScript::wrapObjectsInArray(ErrorString* errorString, v8::Local<v8:: |
v8::MaybeLocal<v8::Value> InjectedScript::wrapValue(ErrorString* errorString, v8::Local<v8::Value> value, const String16& groupName, bool forceValueType, bool generatePreview) const |
{ |
- V8FunctionCall function(m_context->debugger(), m_context->context(), v8Value(), "wrapObject"); |
+ V8FunctionCall function(m_context->inspector(), m_context->context(), v8Value(), "wrapObject"); |
function.appendArgument(value); |
function.appendArgument(groupName); |
function.appendArgument(forceValueType); |
@@ -219,7 +218,7 @@ v8::MaybeLocal<v8::Value> InjectedScript::wrapValue(ErrorString* errorString, v8 |
std::unique_ptr<protocol::Runtime::RemoteObject> InjectedScript::wrapTable(v8::Local<v8::Value> table, v8::Local<v8::Value> columns) const |
{ |
v8::HandleScope handles(m_context->isolate()); |
- V8FunctionCall function(m_context->debugger(), m_context->context(), v8Value(), "wrapTable"); |
+ V8FunctionCall function(m_context->inspector(), m_context->context(), v8Value(), "wrapTable"); |
function.appendArgument(table); |
if (columns.IsEmpty()) |
function.appendArgument(false); |
@@ -256,7 +255,7 @@ void InjectedScript::releaseObjectGroup(const String16& objectGroup) |
void InjectedScript::setCustomObjectFormatterEnabled(bool enabled) |
{ |
v8::HandleScope handles(m_context->isolate()); |
- V8FunctionCall function(m_context->debugger(), m_context->context(), v8Value(), "setCustomObjectFormatterEnabled"); |
+ V8FunctionCall function(m_context->inspector(), m_context->context(), v8Value(), "setCustomObjectFormatterEnabled"); |
function.appendArgument(enabled); |
bool hadException = false; |
function.call(hadException); |
@@ -295,7 +294,7 @@ v8::MaybeLocal<v8::Value> InjectedScript::resolveCallArgument(ErrorString* error |
if (callArgument->getType(String16()) == "number") |
value = "Number(" + value + ")"; |
v8::Local<v8::Value> object; |
- if (!m_context->debugger()->compileAndRunInternalScript(m_context->context(), toV8String(m_context->isolate(), value)).ToLocal(&object)) { |
+ if (!m_context->inspector()->compileAndRunInternalScript(m_context->context(), toV8String(m_context->isolate(), value)).ToLocal(&object)) { |
*errorString = "Couldn't parse value object in call argument"; |
return v8::MaybeLocal<v8::Value>(); |
} |
@@ -315,7 +314,7 @@ std::unique_ptr<protocol::Runtime::ExceptionDetails> InjectedScript::createExcep |
v8::Local<v8::StackTrace> stackTrace = message->GetStackTrace(); |
if (!stackTrace.IsEmpty() && stackTrace->GetFrameCount() > 0) |
- exceptionDetailsObject->setStackTrace(m_context->debugger()->createStackTraceImpl(stackTrace)->buildInspectorObjectImpl()); |
+ exceptionDetailsObject->setStackTrace(m_context->inspector()->createStackTraceImpl(stackTrace)->buildInspectorObjectImpl()); |
return exceptionDetailsObject; |
} |
@@ -353,15 +352,15 @@ v8::Local<v8::Object> InjectedScript::commandLineAPI() |
return m_commandLineAPI.Get(m_context->isolate()); |
} |
-InjectedScript::Scope::Scope(ErrorString* errorString, V8DebuggerImpl* debugger, int contextGroupId) |
+InjectedScript::Scope::Scope(ErrorString* errorString, V8InspectorImpl* inspector, int contextGroupId) |
: m_errorString(errorString) |
- , m_debugger(debugger) |
+ , m_inspector(inspector) |
, m_contextGroupId(contextGroupId) |
, m_injectedScript(nullptr) |
- , m_handleScope(debugger->isolate()) |
- , m_tryCatch(debugger->isolate()) |
+ , m_handleScope(inspector->isolate()) |
+ , m_tryCatch(inspector->isolate()) |
, m_ignoreExceptionsAndMuteConsole(false) |
- , m_previousPauseOnExceptionsState(V8DebuggerImpl::DontPauseOnExceptions) |
+ , m_previousPauseOnExceptionsState(V8InspectorImpl::DontPauseOnExceptions) |
, m_userGesture(false) |
{ |
} |
@@ -370,7 +369,7 @@ bool InjectedScript::Scope::initialize() |
{ |
cleanup(); |
// TODO(dgozman): what if we reattach to the same context group during evaluate? Introduce a session id? |
- V8InspectorSessionImpl* session = m_debugger->sessionForContextGroup(m_contextGroupId); |
+ V8InspectorSessionImpl* session = m_inspector->sessionForContextGroup(m_contextGroupId); |
if (!session) { |
*m_errorString = "Internal error"; |
return false; |
@@ -394,17 +393,17 @@ void InjectedScript::Scope::ignoreExceptionsAndMuteConsole() |
{ |
DCHECK(!m_ignoreExceptionsAndMuteConsole); |
m_ignoreExceptionsAndMuteConsole = true; |
- m_debugger->client()->muteWarningsAndDeprecations(m_contextGroupId); |
- m_previousPauseOnExceptionsState = setPauseOnExceptionsState(V8DebuggerImpl::DontPauseOnExceptions); |
+ m_inspector->client()->muteWarningsAndDeprecations(m_contextGroupId); |
+ m_previousPauseOnExceptionsState = setPauseOnExceptionsState(V8InspectorImpl::DontPauseOnExceptions); |
} |
-V8DebuggerImpl::PauseOnExceptionsState InjectedScript::Scope::setPauseOnExceptionsState(V8DebuggerImpl::PauseOnExceptionsState newState) |
+V8InspectorImpl::PauseOnExceptionsState InjectedScript::Scope::setPauseOnExceptionsState(V8InspectorImpl::PauseOnExceptionsState newState) |
{ |
- if (!m_debugger->enabled()) |
+ if (!m_inspector->enabled()) |
return newState; |
- V8DebuggerImpl::PauseOnExceptionsState presentState = m_debugger->getPauseOnExceptionsState(); |
+ V8InspectorImpl::PauseOnExceptionsState presentState = m_inspector->getPauseOnExceptionsState(); |
if (presentState != newState) |
- m_debugger->setPauseOnExceptionsState(newState); |
+ m_inspector->setPauseOnExceptionsState(newState); |
return presentState; |
} |
@@ -412,7 +411,7 @@ void InjectedScript::Scope::pretendUserGesture() |
{ |
DCHECK(!m_userGesture); |
m_userGesture = true; |
- m_debugger->client()->beginUserGesture(); |
+ m_inspector->client()->beginUserGesture(); |
} |
void InjectedScript::Scope::cleanup() |
@@ -428,15 +427,15 @@ InjectedScript::Scope::~Scope() |
{ |
if (m_ignoreExceptionsAndMuteConsole) { |
setPauseOnExceptionsState(m_previousPauseOnExceptionsState); |
- m_debugger->client()->unmuteWarningsAndDeprecations(m_contextGroupId); |
+ m_inspector->client()->unmuteWarningsAndDeprecations(m_contextGroupId); |
} |
if (m_userGesture) |
- m_debugger->client()->endUserGesture(); |
+ m_inspector->client()->endUserGesture(); |
cleanup(); |
} |
-InjectedScript::ContextScope::ContextScope(ErrorString* errorString, V8DebuggerImpl* debugger, int contextGroupId, int executionContextId) |
- : InjectedScript::Scope(errorString, debugger, contextGroupId) |
+InjectedScript::ContextScope::ContextScope(ErrorString* errorString, V8InspectorImpl* inspector, int contextGroupId, int executionContextId) |
+ : InjectedScript::Scope(errorString, inspector, contextGroupId) |
, m_executionContextId(executionContextId) |
{ |
} |
@@ -450,8 +449,8 @@ void InjectedScript::ContextScope::findInjectedScript(V8InspectorSessionImpl* se |
m_injectedScript = session->findInjectedScript(m_errorString, m_executionContextId); |
} |
-InjectedScript::ObjectScope::ObjectScope(ErrorString* errorString, V8DebuggerImpl* debugger, int contextGroupId, const String16& remoteObjectId) |
- : InjectedScript::Scope(errorString, debugger, contextGroupId) |
+InjectedScript::ObjectScope::ObjectScope(ErrorString* errorString, V8InspectorImpl* inspector, int contextGroupId, const String16& remoteObjectId) |
+ : InjectedScript::Scope(errorString, inspector, contextGroupId) |
, m_remoteObjectId(remoteObjectId) |
{ |
} |
@@ -474,8 +473,8 @@ void InjectedScript::ObjectScope::findInjectedScript(V8InspectorSessionImpl* ses |
m_injectedScript = injectedScript; |
} |
-InjectedScript::CallFrameScope::CallFrameScope(ErrorString* errorString, V8DebuggerImpl* debugger, int contextGroupId, const String16& remoteObjectId) |
- : InjectedScript::Scope(errorString, debugger, contextGroupId) |
+InjectedScript::CallFrameScope::CallFrameScope(ErrorString* errorString, V8InspectorImpl* inspector, int contextGroupId, const String16& remoteObjectId) |
+ : InjectedScript::Scope(errorString, inspector, contextGroupId) |
, m_remoteCallFrameId(remoteObjectId) |
{ |
} |