Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Unified Diff: Source/bindings/tests/results/V8TestInterface.cpp

Issue 26792002: Reland: Reland: Implement new Blink IDL attribute [SetReference] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: setWrapperReference_reupl Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/bindings/tests/results/V8TestInterface.cpp
diff --git a/Source/bindings/tests/results/V8TestInterface.cpp b/Source/bindings/tests/results/V8TestInterface.cpp
index a1f7f5f52bdc12bd4e384aebc5962ee89af53d64..a3c1068f6fab4d3b2c147d775afaf1dabac328a3 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 "V8ReachableToType.h"
#include "V8TestObject.h"
#include "bindings/tests/idls/TestImplements.h"
#include "bindings/tests/idls/TestPartialInterface.h"
@@ -64,7 +65,7 @@ void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterface* object
}
namespace WebCore {
-WrapperTypeInfo V8TestInterface::info = { V8TestInterface::GetTemplate, V8TestInterface::derefObject, V8TestInterface::toActiveDOMObject, 0, 0, V8TestInterface::installPerContextPrototypeProperties, 0, WrapperTypeObjectPrototype };
+WrapperTypeInfo V8TestInterface::info = { V8TestInterface::GetTemplate, V8TestInterface::derefObject, V8TestInterface::toActiveDOMObject, 0, V8TestInterface::resolveWrapperReachability, V8TestInterface::installPerContextPrototypeProperties, 0, WrapperTypeObjectPrototype };
namespace TestInterfaceV8Internal {
@@ -925,6 +926,19 @@ 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);
+ ReachableToType* reachableTo = impl->reachableTo();
+ if (reachableTo) {
+ if(! DOMDataStore::containsWrapper<V8ReachableToType>(reachableTo, isolate))
+ wrap(reachableTo, creationContext, isolate);
+ DOMDataStore::setWrapperReferenceFrom<V8ReachableToType>(wrapper, reachableTo, isolate);
+ }
+ setObjectGroup(object, wrapper, isolate);
haraken 2013/10/16 04:46:38 It looks inconsistent that setObjectGroup is a met
kouhei (in TOK) 2013/10/17 02:30:09 setObjectGroup is not a method of WrapperTypeInfo.
haraken 2013/10/17 03:28:22 I still think these methods are misplaced, but it'
+}
+
static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceAttributes[] = {
#if ENABLE(Condition22) || ENABLE(Condition23)
{"implementsStr1", TestInterfaceV8Internal::implementsStr1AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},

Powered by Google App Engine
This is Rietveld 408576698