Chromium Code Reviews| 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 3b155d37ca2b13c5130c16966fc79a648c7b91ef..6d47ab433ad2fe69b09e0adbaafd7134f628dc6f 100644 |
| --- a/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp |
| +++ b/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp |
| @@ -342,6 +342,25 @@ void InjectedScript::releaseObject(const String& objectId) |
| m_native->unbind(boundId); |
| } |
| +v8::MaybeLocal<v8::Value> InjectedScript::runCompiledScript(v8::Local<v8::Script> script, bool includeCommandLineAPI) |
| +{ |
| + v8::Local<v8::Symbol> commandLineAPISymbolValue = V8Debugger::commandLineAPISymbol(m_isolate); |
| + v8::Local<v8::Object> global = context()->Global(); |
| + if (includeCommandLineAPI) { |
| + V8FunctionCall function(m_client, context(), v8Value(), "commandLineAPI"); |
| + bool hadException = false; |
| + v8::Local<v8::Value> commandLineAPI = function.call(hadException, false); |
| + if (!hadException) |
| + global->Set(commandLineAPISymbolValue, commandLineAPI->ToObject(m_isolate)); |
|
dgozman
2016/02/18 01:28:33
nit: remove ->ToObject
kozy
2016/02/18 01:55:01
Done.
|
| + } |
| + |
| + v8::MaybeLocal<v8::Value> maybeValue = m_client->runCompiledScript(context(), script); |
| + if (includeCommandLineAPI) |
| + global->Delete(context(), commandLineAPISymbolValue); |
| + |
| + return maybeValue; |
| +} |
| + |
| PassRefPtr<Array<CallFrame>> InjectedScript::wrapCallFrames(v8::Local<v8::Object> callFrames, int asyncOrdinal) |
| { |
| v8::HandleScope handles(m_isolate); |