Chromium Code Reviews| Index: Source/bindings/tests/results/V8TestInterface.cpp |
| diff --git a/Source/bindings/tests/results/V8TestInterface.cpp b/Source/bindings/tests/results/V8TestInterface.cpp |
| index 4dc58ea64b423c13bf046996f96b5e7a18f0d758..92d0408067f250b9ba65d16674add927f89ae277 100644 |
| --- a/Source/bindings/tests/results/V8TestInterface.cpp |
| +++ b/Source/bindings/tests/results/V8TestInterface.cpp |
| @@ -25,6 +25,7 @@ |
| #include "RuntimeEnabledFeatures.h" |
| #include "V8Node.h" |
| #include "V8NodeList.h" |
| +#include "V8ReferencedType.h" |
| #include "V8TestObject.h" |
| #include "bindings/tests/idls/TestImplements.h" |
| #include "bindings/tests/idls/TestPartialInterface.h" |
| @@ -66,7 +67,7 @@ void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterface* object |
| } |
| namespace WebCore { |
| -const WrapperTypeInfo V8TestInterface::wrapperTypeInfo = { V8TestInterface::GetTemplate, V8TestInterface::derefObject, V8TestInterface::toActiveDOMObject, 0, 0, V8TestInterface::installPerContextEnabledPrototypeProperties, 0, WrapperTypeObjectPrototype }; |
| +const WrapperTypeInfo V8TestInterface::wrapperTypeInfo = { V8TestInterface::GetTemplate, V8TestInterface::derefObject, V8TestInterface::toActiveDOMObject, 0, V8TestInterface::resolveWrapperReachability, V8TestInterface::installPerContextEnabledPrototypeProperties, 0, WrapperTypeObjectPrototype }; |
| namespace TestInterfaceV8Internal { |
| @@ -788,6 +789,20 @@ static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro |
| } // namespace TestInterfaceV8Internal |
| +void V8TestInterface::resolveWrapperReachability(void* object, const v8::Persistent<v8::Object>& wrapper, v8::Isolate* isolate) |
| +{ |
| + TestInterface* impl = fromInternalPointer(object); |
| + v8::Local<v8::Object> creationContext = v8::Local<v8::Object>::New(isolate, wrapper); |
| + V8WrapperInstantiationScope scope(creationContext, isolate); |
|
haraken
2013/10/29 01:14:53
You can move this into the if branch.
This is OK
kouhei (in TOK)
2013/10/29 04:19:58
There may be multiple [SetReference]s, so I think
|
| + ReferencedType* referencedName = impl->referencedName(); |
| + if (referencedName) { |
| + if (!DOMDataStore::containsWrapper<V8ReferencedType>(referencedName, isolate)) |
| + wrap(referencedName, creationContext, isolate); |
| + DOMDataStore::setWrapperReference<V8ReferencedType>(wrapper, referencedName, isolate); |
| + } |
| + setObjectGroup(object, wrapper, isolate); |
| +} |
| + |
| static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceAttributes[] = { |
| {"implementsStr1", TestInterfaceV8Internal::implementsStr1AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"implementsStr2", TestInterfaceV8Internal::implementsStr2AttributeGetterCallback, TestInterfaceV8Internal::implementsStr2AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |