Index: third_party/WebKit/Source/platform/v8_inspector/V8FunctionCall.cpp |
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8FunctionCall.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8FunctionCall.cpp |
index 03274ad89beb85cfb05577d5b8f0af42024cb5a8..557dc58a66786387b3db185536ba45b8d17acb35 100644 |
--- a/third_party/WebKit/Source/platform/v8_inspector/V8FunctionCall.cpp |
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8FunctionCall.cpp |
@@ -30,6 +30,7 @@ |
#include "platform/v8_inspector/V8FunctionCall.h" |
+#include "platform/v8_inspector/V8DebuggerImpl.h" |
#include "platform/v8_inspector/V8StringUtil.h" |
#include "platform/v8_inspector/public/V8DebuggerClient.h" |
#include "wtf/PassOwnPtr.h" |
@@ -38,8 +39,8 @@ |
namespace blink { |
-V8FunctionCall::V8FunctionCall(V8DebuggerClient* client, v8::Local<v8::Context> context, v8::Local<v8::Value> value, const String& name) |
- : m_client(client) |
+V8FunctionCall::V8FunctionCall(V8DebuggerImpl* debugger, v8::Local<v8::Context> context, v8::Local<v8::Value> value, const String& name) |
+ : m_debugger(debugger) |
, m_context(context) |
, m_name(toV8String(context->GetIsolate(), name)) |
, m_value(value) |
@@ -89,6 +90,10 @@ v8::Local<v8::Value> V8FunctionCall::call() |
v8::Local<v8::Value> V8FunctionCall::callWithoutExceptionHandling() |
{ |
+ // TODO(dgozman): get rid of this check. |
+ if (!m_debugger->client()->isExecutionAllowed()) |
+ return v8::Local<v8::Value>(); |
+ |
v8::Local<v8::Object> thisObject = v8::Local<v8::Object>::Cast(m_value); |
v8::Local<v8::Value> value; |
if (!thisObject->Get(m_context, m_name).ToLocal(&value)) |
@@ -103,8 +108,13 @@ v8::Local<v8::Value> V8FunctionCall::callWithoutExceptionHandling() |
ASSERT(!info[i].IsEmpty()); |
} |
+ v8::MicrotasksScope microtasksScope(m_context->GetIsolate(), v8::MicrotasksScope::kRunMicrotasks); |
+ int cookie = m_debugger->willExecuteScript(m_context, function->ScriptId()); |
pfeldman
2016/03/08 01:44:21
m_debugger-callFunction.
dgozman
2016/03/08 02:23:00
Done.
|
+ v8::MaybeLocal<v8::Value> maybeResult = function->Call(m_context, thisObject, m_arguments.size(), info.get()); |
+ m_debugger->didExecuteScript(cookie); |
+ |
v8::Local<v8::Value> result; |
- if (!m_client->callFunction(function, m_context, thisObject, m_arguments.size(), info.get()).ToLocal(&result)) |
+ if (!maybeResult.ToLocal(&result)) |
return v8::Local<v8::Value>(); |
return result; |
} |