Chromium Code Reviews| 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 816633be0bfd9cf62a4952fcc6334bb51fed076b..09b7f456dba4c8096d1b9f31cdd206f36caed65e 100644 |
| --- a/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp |
| +++ b/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp |
| @@ -288,11 +288,11 @@ void V8InjectedScriptHost::evalCallback(const v8::FunctionCallbackInfo<v8::Value |
| ASSERT(isolate->InContext()); |
| v8::TryCatch tryCatch(isolate); |
| - v8::Local<v8::Value> result; |
| InjectedScriptHost* host = V8InjectedScriptHost::unwrap(isolate->GetCurrentContext(), info.Holder()); |
| if (!host->debugger()) |
| return; |
| - if (!host->debugger()->client()->compileAndRunInternalScript(expression).ToLocal(&result)) { |
| + v8::Local<v8::Value> result = host->debugger()->compileAndRunInternalScript(isolate->GetCurrentContext(), expression); |
|
pfeldman
2016/03/08 20:23:21
Do we have to change the contract here? Returning
dgozman
2016/03/09 22:01:53
Yeah, lost in transition. Reverted back.
|
| + if (result.IsEmpty()) { |
| v8SetReturnValue(info, tryCatch.ReThrow()); |
| return; |
| } |
| @@ -332,6 +332,10 @@ void V8InjectedScriptHost::evaluateWithExceptionDetailsCallback(const v8::Functi |
| if (!host->debugger()) |
| return; |
| + // TODO(dgozman): get rid of this check. |
| + if (!host->debugger()->client()->isExecutionAllowed()) |
|
pfeldman
2016/03/08 20:23:21
ditto
dgozman
2016/03/09 22:01:53
Done.
|
| + return; |
| + |
| v8::Local<v8::Script> script = host->debugger()->compileInternalScript(context, expression, String()); |
| if (script.IsEmpty()) { |
| setExceptionAsReturnValue(info, wrappedResult, tryCatch); |
| @@ -345,7 +349,7 @@ void V8InjectedScriptHost::evaluateWithExceptionDetailsCallback(const v8::Functi |
| global->Set(commandLineAPISymbolValue, commandLineAPI); |
| } |
| - v8::MaybeLocal<v8::Value> result = host->debugger()->client()->runCompiledScript(context, script); |
| + v8::MaybeLocal<v8::Value> result = host->debugger()->runCompiledScript(context, script); |
| if (result.IsEmpty()) { |
| global->Delete(context, commandLineAPISymbolValue); |
| setExceptionAsReturnValue(info, wrappedResult, tryCatch); |
| @@ -598,9 +602,9 @@ v8::Local<v8::FunctionTemplate> V8InjectedScriptHost::createWrapperTemplate(v8:: |
| return InjectedScriptHostWrapper::createWrapperTemplate(isolate, methods, attributes); |
| } |
| -v8::Local<v8::Object> V8InjectedScriptHost::wrap(V8DebuggerClient* client, v8::Local<v8::FunctionTemplate> constructorTemplate, v8::Local<v8::Context> context, InjectedScriptHost* host) |
| +v8::Local<v8::Object> V8InjectedScriptHost::wrap(v8::Local<v8::FunctionTemplate> constructorTemplate, v8::Local<v8::Context> context, InjectedScriptHost* host) |
| { |
| - return InjectedScriptHostWrapper::wrap(client, constructorTemplate, context, host); |
| + return InjectedScriptHostWrapper::wrap(constructorTemplate, context, host); |
| } |
| InjectedScriptHost* V8InjectedScriptHost::unwrap(v8::Local<v8::Context> context, v8::Local<v8::Object> object) |