| 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 c7c8fb462b1cf15d44b3b4bb55030756cd5659f4..25262a07133889246cb403ba0d034302d825ff00 100644
|
| --- a/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp
|
| +++ b/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp
|
| @@ -76,18 +76,6 @@ InjectedScript::~InjectedScript()
|
| {
|
| }
|
|
|
| -void InjectedScript::callFunctionOn(ErrorString* errorString, const String16& objectId, const String16& expression, const String16& arguments, bool returnByValue, bool generatePreview, OwnPtr<protocol::Runtime::RemoteObject>* result, Maybe<bool>* wasThrown)
|
| -{
|
| - v8::HandleScope handles(m_isolate);
|
| - V8FunctionCall function(m_manager->debugger(), context(), v8Value(), "callFunctionOn");
|
| - function.appendArgument(objectId);
|
| - function.appendArgument(expression);
|
| - function.appendArgument(arguments);
|
| - function.appendArgument(returnByValue);
|
| - function.appendArgument(generatePreview);
|
| - *result = makeEvalCall(errorString, function, wasThrown);
|
| -}
|
| -
|
| void InjectedScript::getFunctionDetails(ErrorString* errorString, const String16& functionId, OwnPtr<FunctionDetails>* result)
|
| {
|
| v8::HandleScope handles(m_isolate);
|
| @@ -322,34 +310,6 @@ PassOwnPtr<protocol::Value> InjectedScript::makeCall(V8FunctionCall& function)
|
| return result.release();
|
| }
|
|
|
| -PassOwnPtr<protocol::Runtime::RemoteObject> InjectedScript::makeEvalCall(ErrorString* errorString, V8FunctionCall& function, Maybe<bool>* wasThrown)
|
| -{
|
| - OwnPtr<protocol::Value> result = makeCall(function);
|
| - if (!result) {
|
| - *errorString = "Internal error: result value is empty";
|
| - return nullptr;
|
| - }
|
| - if (result->type() == protocol::Value::TypeString) {
|
| - result->asString(errorString);
|
| - ASSERT(errorString->length());
|
| - return nullptr;
|
| - }
|
| - protocol::DictionaryValue* resultPair = protocol::DictionaryValue::cast(result.get());
|
| - if (!resultPair) {
|
| - *errorString = "Internal error: result is not an Object";
|
| - return nullptr;
|
| - }
|
| - protocol::DictionaryValue* resultObj = resultPair->getObject("result");
|
| - bool wasThrownVal = false;
|
| - if (!resultObj || !resultPair->getBoolean("wasThrown", &wasThrownVal)) {
|
| - *errorString = "Internal error: result is not a pair of value and wasThrown flag";
|
| - return nullptr;
|
| - }
|
| - protocol::ErrorSupport errors(errorString);
|
| - *wasThrown = wasThrownVal;
|
| - return protocol::Runtime::RemoteObject::parse(resultObj, &errors);
|
| -}
|
| -
|
| PassOwnPtr<protocol::Value> InjectedScript::makeCallWithExceptionDetails(V8FunctionCall& function, Maybe<protocol::Runtime::ExceptionDetails>* exceptionDetails)
|
| {
|
| OwnPtr<protocol::Value> result;
|
| @@ -418,7 +378,17 @@ v8::MaybeLocal<v8::Value> InjectedScript::resolveCallArgument(ErrorString* error
|
|
|
| v8::MaybeLocal<v8::Object> InjectedScript::commandLineAPI(ErrorString* errorString)
|
| {
|
| - V8FunctionCall function(m_manager->debugger(), context(), v8Value(), "commandLineAPI");
|
| + return callFunctionWithoutArguments(errorString, "commandLineAPI");
|
| +}
|
| +
|
| +v8::MaybeLocal<v8::Object> InjectedScript::remoteObjectAPI(ErrorString* errorString)
|
| +{
|
| + return callFunctionWithoutArguments(errorString, "remoteObjectAPI");
|
| +}
|
| +
|
| +v8::MaybeLocal<v8::Object> InjectedScript::callFunctionWithoutArguments(ErrorString* errorString, const String16& name)
|
| +{
|
| + V8FunctionCall function(m_manager->debugger(), context(), v8Value(), name);
|
| bool hadException = false;
|
| v8::Local<v8::Value> scopeExtensionValue = function.call(hadException, false);
|
| v8::Local<v8::Object> scopeExtensionObject;
|
| @@ -470,7 +440,8 @@ void InjectedScript::wrapEvaluateResult(ErrorString* errorString, v8::MaybeLocal
|
| if (!remoteObject)
|
| return;
|
| *result = remoteObject.release();
|
| - *exceptionDetails = createExceptionDetails(tryCatch.Message());
|
| + if (exceptionDetails)
|
| + *exceptionDetails = createExceptionDetails(tryCatch.Message());
|
| if (wasThrown)
|
| *wasThrown = true;
|
| }
|
|
|