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

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

Issue 2190353004: [DevTools] Replace InjectedScriptHost.suppressWarningsAndCallFunction with hasOwnProperty. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 5 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/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 73edc7260f0719280dd78d23a86aca26582f43d8..f5852b308cdb0ec4507dfacceecd09970fcd045f 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8FunctionCall.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8FunctionCall.cpp
@@ -68,11 +68,6 @@ void V8FunctionCall::appendArgument(bool argument)
m_arguments.push_back(argument ? v8::True(m_context->GetIsolate()) : v8::False(m_context->GetIsolate()));
}
-void V8FunctionCall::appendUndefinedArgument()
-{
- m_arguments.push_back(v8::Undefined(m_context->GetIsolate()));
-}
-
v8::Local<v8::Value> V8FunctionCall::call(bool& hadException, bool reportExceptions)
{
v8::TryCatch tryCatch(m_context->GetIsolate());
@@ -103,23 +98,18 @@ v8::Local<v8::Value> V8FunctionCall::callWithoutExceptionHandling()
DCHECK(!info[i].IsEmpty());
}
+ int contextGroupId = V8DebuggerImpl::getGroupId(m_context);
+ if (contextGroupId)
+ m_debugger->client()->muteWarningsAndDeprecations(contextGroupId);
v8::MicrotasksScope microtasksScope(m_context->GetIsolate(), v8::MicrotasksScope::kDoNotRunMicrotasks);
+ v8::MaybeLocal<v8::Value> maybeResult = function->Call(m_context, thisObject, m_arguments.size(), info.get());
+ if (contextGroupId)
+ m_debugger->client()->unmuteWarningsAndDeprecations(contextGroupId);
+
v8::Local<v8::Value> result;
- if (!function->Call(m_context, thisObject, m_arguments.size(), info.get()).ToLocal(&result))
+ if (!maybeResult.ToLocal(&result))
return v8::Local<v8::Value>();
return result;
}
-v8::Local<v8::Function> V8FunctionCall::function()
-{
- v8::TryCatch tryCatch(m_context->GetIsolate());
- 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))
- return v8::Local<v8::Function>();
-
- DCHECK(value->IsFunction());
- return v8::Local<v8::Function>::Cast(value);
-}
-
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698