summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/WebKit/Source/bindings/v8/V8ObjectConstructor.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/WebKit/Source/bindings/v8/V8ObjectConstructor.h')
-rw-r--r--chromium/third_party/WebKit/Source/bindings/v8/V8ObjectConstructor.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/chromium/third_party/WebKit/Source/bindings/v8/V8ObjectConstructor.h b/chromium/third_party/WebKit/Source/bindings/v8/V8ObjectConstructor.h
index 2c9f6a26020..e1d204fa606 100644
--- a/chromium/third_party/WebKit/Source/bindings/v8/V8ObjectConstructor.h
+++ b/chromium/third_party/WebKit/Source/bindings/v8/V8ObjectConstructor.h
@@ -32,6 +32,7 @@
#define V8ObjectConstructor_h
#include "bindings/v8/V8PerIsolateData.h"
+#include "bindings/v8/V8RecursionScope.h"
#include <v8.h>
@@ -46,31 +47,37 @@ public:
CreateNewObject
};
- ConstructorMode()
+ ConstructorMode(v8::Isolate* isolate)
+ : m_isolate(isolate)
+ , m_microtaskSuppression(isolate)
{
- V8PerIsolateData* data = V8PerIsolateData::current();
+ V8PerIsolateData* data = V8PerIsolateData::from(m_isolate);
m_previous = data->m_constructorMode;
data->m_constructorMode = WrapExistingObject;
}
~ConstructorMode()
{
- V8PerIsolateData* data = V8PerIsolateData::current();
+ V8PerIsolateData* data = V8PerIsolateData::from(m_isolate);
data->m_constructorMode = m_previous;
}
- static bool current() { return V8PerIsolateData::current()->m_constructorMode; }
+ static bool current(v8::Isolate* isolate)
+ {
+ return V8PerIsolateData::from(isolate)->m_constructorMode;
+ }
private:
+ v8::Isolate* m_isolate;
bool m_previous;
+ V8RecursionScope::MicrotaskSuppression m_microtaskSuppression;
};
class V8ObjectConstructor {
public:
- static v8::Local<v8::Object> newInstance(v8::Handle<v8::Function>);
- static v8::Local<v8::Object> newInstance(v8::Handle<v8::ObjectTemplate>);
- static v8::Local<v8::Object> newInstance(v8::Handle<v8::Function>, int, v8::Handle<v8::Value> argv[]);
- static v8::Local<v8::Object> newInstanceInDocument(v8::Handle<v8::Function>, int, v8::Handle<v8::Value> argv[], Document*);
+ static v8::Local<v8::Object> newInstance(v8::Isolate*, v8::Handle<v8::Function>);
+ static v8::Local<v8::Object> newInstance(v8::Isolate*, v8::Handle<v8::Function>, int, v8::Handle<v8::Value> argv[]);
+ static v8::Local<v8::Object> newInstanceInDocument(v8::Isolate*, v8::Handle<v8::Function>, int, v8::Handle<v8::Value> argv[], Document*);
static void isValidConstructorMode(const v8::FunctionCallbackInfo<v8::Value>&);
};