| Index: third_party/WebKit/Source/bindings/core/v8/V8ObjectConstructor.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ObjectConstructor.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ObjectConstructor.cpp
|
| index c7c9fe020f421caac35e574149fd3aa161026d00..9536093bf8465d4ed9b527387f9eb0882a96a270 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/V8ObjectConstructor.cpp
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8ObjectConstructor.cpp
|
| @@ -25,40 +25,24 @@
|
| #include "bindings/core/v8/V8ObjectConstructor.h"
|
|
|
| #include "bindings/core/v8/V8Binding.h"
|
| -#include "bindings/core/v8/V8ScriptRunner.h"
|
| -#include "core/dom/Document.h"
|
| -#include "core/frame/LocalFrame.h"
|
| #include "platform/instrumentation/tracing/TraceEvent.h"
|
|
|
| namespace blink {
|
|
|
| v8::MaybeLocal<v8::Object> V8ObjectConstructor::newInstance(
|
| v8::Isolate* isolate,
|
| - v8::Local<v8::Function> function) {
|
| - ASSERT(!function.IsEmpty());
|
| - ConstructorMode constructorMode(isolate);
|
| - return V8ScriptRunner::instantiateObject(isolate, function);
|
| -}
|
| -
|
| -v8::MaybeLocal<v8::Object> V8ObjectConstructor::newInstance(
|
| - v8::Isolate* isolate,
|
| v8::Local<v8::Function> function,
|
| int argc,
|
| v8::Local<v8::Value> argv[]) {
|
| ASSERT(!function.IsEmpty());
|
| + TRACE_EVENT0("v8", "v8.newInstance");
|
| ConstructorMode constructorMode(isolate);
|
| - return V8ScriptRunner::instantiateObject(isolate, function, argc, argv);
|
| -}
|
| -
|
| -v8::MaybeLocal<v8::Object> V8ObjectConstructor::newInstanceInDocument(
|
| - v8::Isolate* isolate,
|
| - v8::Local<v8::Function> function,
|
| - int argc,
|
| - v8::Local<v8::Value> argv[],
|
| - Document* document) {
|
| - ASSERT(!function.IsEmpty());
|
| - return V8ScriptRunner::instantiateObjectInDocument(isolate, function,
|
| - document, argc, argv);
|
| + v8::MicrotasksScope microtasksScope(isolate,
|
| + v8::MicrotasksScope::kDoNotRunMicrotasks);
|
| + v8::MaybeLocal<v8::Object> result =
|
| + function->NewInstance(isolate->GetCurrentContext(), argc, argv);
|
| + CHECK(!isolate->IsDead());
|
| + return result;
|
| }
|
|
|
| void V8ObjectConstructor::isValidConstructorMode(
|
|
|