Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp b/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
| index 0396898eebd7e46c7576985d3328c75425483b16..e36f340f95519d74247d4d2a8131327d2f1d08dc 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
| @@ -29,6 +29,7 @@ |
| #include "bindings/core/v8/V8DOMConfiguration.h" |
| #include "bindings/core/v8/V8ObjectConstructor.h" |
| +#include "bindings/core/v8/V8PerContextData.h" |
| #include "platform/TraceEvent.h" |
| namespace blink { |
| @@ -68,13 +69,22 @@ void installAttributeInternal(v8::Isolate* isolate, v8::Local<v8::Object> instan |
| return; |
| v8::Local<v8::Name> name = v8AtomicString(isolate, attribute.name); |
| - v8::Local<v8::Value> data = v8::External::New(isolate, const_cast<WrapperTypeInfo*>(attribute.data)); |
| + |
| + // This method is only being used for installing interfaces which are |
| + // enabled through origin trials. Assert here that it is being called with |
| + // an attribute conguration for a constructor. |
|
haraken
2016/05/31 00:16:32
configuration
iclelland
2016/05/31 03:17:31
Done.
|
| + // TODO(iclelland): Relax this constraint and allow arbitrary data-type |
| + // properties to be added here. |
| + DCHECK_EQ(&v8ConstructorAttributeGetter, attribute.getter); |
| + |
| + V8PerContextData* perContextData = V8PerContextData::from(isolate->GetCurrentContext()); |
| + v8::Local<v8::Function> data = perContextData->constructorForType(attribute.data); |
| DCHECK(attribute.propertyLocationConfiguration); |
| if (attribute.propertyLocationConfiguration & V8DOMConfiguration::OnInstance) |
| - v8CallOrCrash(instance->DefineOwnProperty(isolate->GetCurrentContext(), name, data, static_cast<v8::PropertyAttribute>(attribute.attribute))); |
| + v8CallOrCrash(instance->DefineOwnProperty(isolate->GetCurrentContext(), name, data)); |
| if (attribute.propertyLocationConfiguration & V8DOMConfiguration::OnPrototype) |
| - v8CallOrCrash(prototype->DefineOwnProperty(isolate->GetCurrentContext(), name, data, static_cast<v8::PropertyAttribute>(attribute.attribute))); |
| + v8CallOrCrash(prototype->DefineOwnProperty(isolate->GetCurrentContext(), name, data)); |
| if (attribute.propertyLocationConfiguration & V8DOMConfiguration::OnInterface) |
| NOTREACHED(); |
| } |