Index: Source/bindings/tests/results/V8TestObject.cpp |
diff --git a/Source/bindings/tests/results/V8TestObject.cpp b/Source/bindings/tests/results/V8TestObject.cpp |
index 5221a391d83d0886fd7a2c423db94057cf1a4d2e..27216b484f61778246444e29dc713ff09a41262e 100644 |
--- a/Source/bindings/tests/results/V8TestObject.cpp |
+++ b/Source/bindings/tests/results/V8TestObject.cpp |
@@ -84,7 +84,7 @@ |
} |
namespace blink { |
-const WrapperTypeInfo V8TestObject::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestObject::domTemplate, V8TestObject::derefObject, 0, 0, 0, V8TestObject::installConditionallyEnabledMethods, 0, WrapperTypeObjectPrototype, RefCountedObject }; |
+const WrapperTypeInfo V8TestObject::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestObject::domTemplate, V8TestObject::derefObject, 0, 0, 0, V8TestObject::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype, RefCountedObject }; |
namespace TestObjectV8Internal { |
@@ -10617,31 +10617,28 @@ |
return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Object>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) : 0; |
} |
-void V8TestObject::installConditionallyEnabledProperties(v8::Handle<v8::Object> instanceTemplate, v8::Isolate* isolate) |
+void V8TestObject::installPerContextEnabledProperties(v8::Handle<v8::Object> instanceTemplate, TestObject* impl, v8::Isolate* isolate) |
{ |
v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instanceTemplate->GetPrototype()); |
- ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationContext()); |
- |
- if (context && context->isDocument() && ContextFeatures::featureNameEnabled(toDocument(context))) { |
+ if (ContextFeatures::featureNameEnabled(impl->document())) { |
static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\ |
{"perContextEnabledLongAttribute", TestObjectV8Internal::perContextEnabledLongAttributeAttributeGetterCallback, TestObjectV8Internal::perContextEnabledLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}; |
V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate); |
} |
- if (context && context->isDocument() && ContextFeatures::featureNameEnabled(toDocument(context))) { |
+ if (ContextFeatures::featureNameEnabled(impl->document())) { |
static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\ |
{"perContextEnabledRuntimeEnabledLongAttribute", TestObjectV8Internal::perContextEnabledRuntimeEnabledLongAttributeAttributeGetterCallback, TestObjectV8Internal::perContextEnabledRuntimeEnabledLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}; |
V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate); |
} |
} |
-void V8TestObject::installConditionallyEnabledMethods(v8::Handle<v8::Object> prototypeTemplate, v8::Isolate* isolate) |
+void V8TestObject::installPerContextEnabledMethods(v8::Handle<v8::Object> prototypeTemplate, v8::Isolate* isolate) |
{ |
v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domTemplate(isolate)); |
+ |
ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationContext()); |
- |
- if (context && context->isDocument() && ContextFeatures::featureNameEnabled(toDocument(context))) { |
+ if (context && context->isDocument() && ContextFeatures::featureNameEnabled(toDocument(context))) |
prototypeTemplate->Set(v8AtomicString(isolate, "perContextEnabledVoidMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::perContextEnabledVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction()); |
- } |
} |
v8::Handle<v8::Object> wrap(TestObject* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
@@ -10666,7 +10663,7 @@ |
if (UNLIKELY(wrapper.IsEmpty())) |
return wrapper; |
- installConditionallyEnabledProperties(wrapper, isolate); |
+ installPerContextEnabledProperties(wrapper, impl.get(), isolate); |
V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); |
return wrapper; |
} |