Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp

Issue 1812983002: [DevTools] Move evaluate from InjectedScriptSource.js to native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-evaluate-on-call-frame
Patch Set: Removed _callFrameForId Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp
index 6096010615cdaecd1b83510ffed346384e8a1e66..f8a198ffc61c684a12730009a1cc0b3889976219 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp
@@ -287,65 +287,6 @@ void V8InjectedScriptHost::evalCallback(const v8::FunctionCallbackInfo<v8::Value
v8SetReturnValue(info, result);
}
-static void setExceptionAsReturnValue(const v8::FunctionCallbackInfo<v8::Value>& info, v8::Local<v8::Object> returnValue, v8::TryCatch& tryCatch)
-{
- v8::Isolate* isolate = info.GetIsolate();
- returnValue->Set(v8::String::NewFromUtf8(isolate, "result"), tryCatch.Exception());
- returnValue->Set(v8::String::NewFromUtf8(isolate, "exceptionDetails"), JavaScriptCallFrame::createExceptionDetails(isolate, tryCatch.Message()));
- v8SetReturnValue(info, returnValue);
-}
-
-void V8InjectedScriptHost::evaluateWithExceptionDetailsCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
- v8::Isolate* isolate = info.GetIsolate();
- if (info.Length() < 1) {
- isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(isolate, "One argument expected.")));
- return;
- }
-
- v8::Local<v8::String> expression = info[0]->ToString(isolate);
- if (expression.IsEmpty()) {
- isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(isolate, "The argument must be a string.")));
- return;
- }
-
- ASSERT(isolate->InContext());
- v8::Local<v8::Object> wrappedResult = v8::Object::New(isolate);
- if (wrappedResult.IsEmpty())
- return;
-
- v8::TryCatch tryCatch(isolate);
- v8::Local<v8::Context> context = isolate->GetCurrentContext();
- InjectedScriptHost* host = V8InjectedScriptHost::unwrap(context, info.Holder());
- if (!host->debugger())
- return;
-
- v8::Local<v8::Script> script = host->debugger()->compileInternalScript(context, expression, String16());
- if (script.IsEmpty()) {
- setExceptionAsReturnValue(info, wrappedResult, tryCatch);
- return;
- }
-
- v8::Local<v8::Symbol> scopeExtensionSymbolValue = V8Debugger::scopeExtensionSymbol(isolate);
- v8::Local<v8::Object> global = context->Global();
- if (info.Length() >= 2 && info[1]->IsObject()) {
- v8::Local<v8::Object> commandLineAPI = info[1]->ToObject(isolate);
- global->Set(scopeExtensionSymbolValue, commandLineAPI);
- }
-
- v8::MaybeLocal<v8::Value> result = host->debugger()->runCompiledScript(context, script);
- if (result.IsEmpty()) {
- global->Delete(context, scopeExtensionSymbolValue);
- setExceptionAsReturnValue(info, wrappedResult, tryCatch);
- return;
- }
-
- global->Delete(context, scopeExtensionSymbolValue);
- wrappedResult->Set(v8::String::NewFromUtf8(isolate, "result"), result.ToLocalChecked());
- wrappedResult->Set(v8::String::NewFromUtf8(isolate, "exceptionDetails"), v8::Undefined(isolate));
- v8SetReturnValue(info, wrappedResult);
-}
-
static bool getFunctionLocation(const v8::FunctionCallbackInfo<v8::Value>& info, String16* scriptId, int* lineNumber, int* columnNumber)
{
if (info.Length() < 1 || !info[0]->IsFunction())
@@ -557,7 +498,6 @@ const InjectedScriptHostWrapper::V8MethodConfiguration V8InjectedScriptHostMetho
{"getInternalProperties", V8InjectedScriptHost::getInternalPropertiesCallback},
{"getEventListeners", V8InjectedScriptHost::getEventListenersCallback},
{"eval", V8InjectedScriptHost::evalCallback},
- {"evaluateWithExceptionDetails", V8InjectedScriptHost::evaluateWithExceptionDetailsCallback},
{"debugFunction", V8InjectedScriptHost::debugFunctionCallback},
{"undebugFunction", V8InjectedScriptHost::undebugFunctionCallback},
{"monitorFunction", V8InjectedScriptHost::monitorFunctionCallback},

Powered by Google App Engine
This is Rietveld 408576698