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

Unified Diff: third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp

Issue 2124183003: Remove constructor from remaining functions that aren't constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/core/inspector/ThreadDebugger.cpp
diff --git a/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp b/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp
index f76be3e609b34071a764e1d7556f8de95ecc3009..80e3085bf13920c9988fa3aaac6ff0fe081b0472 100644
--- a/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp
+++ b/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp
@@ -173,12 +173,12 @@ void ThreadDebugger::createFunctionProperty(v8::Local<v8::Context> context, v8::
{
v8::Local<v8::String> funcName = v8String(context->GetIsolate(), name);
v8::Local<v8::Function> func;
- if (!v8::Function::New(context, callback, v8::External::New(context->GetIsolate(), this)).ToLocal(&func))
+ if (!v8::Function::New(context, callback, v8::External::New(context->GetIsolate(), this), 0, v8::ConstructorBehavior::kThrow).ToLocal(&func))
return;
func->SetName(funcName);
v8::Local<v8::String> returnValue = v8String(context->GetIsolate(), description);
v8::Local<v8::Function> toStringFunction;
- if (v8::Function::New(context, returnDataCallback, returnValue).ToLocal(&toStringFunction))
+ if (v8::Function::New(context, returnDataCallback, returnValue, 0, v8::ConstructorBehavior::kThrow).ToLocal(&toStringFunction))
func->Set(v8String(context->GetIsolate(), "toString"), toStringFunction);
if (!object->Set(context, funcName, func).FromMaybe(false))
return;
@@ -241,7 +241,7 @@ void ThreadDebugger::logCallback(const v8::FunctionCallbackInfo<v8::Value>& info
v8::Local<v8::Function> ThreadDebugger::eventLogFunction()
{
if (m_eventLogFunction.IsEmpty())
- m_eventLogFunction.Reset(m_isolate, v8::Function::New(m_isolate, logCallback, v8::External::New(m_isolate, this)));
+ m_eventLogFunction.Reset(m_isolate, v8::Function::New(m_isolate->GetCurrentContext(), logCallback, v8::External::New(m_isolate, this), 0, v8::ConstructorBehavior::kThrow).ToLocalChecked());
return m_eventLogFunction.Get(m_isolate);
}

Powered by Google App Engine
This is Rietveld 408576698