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

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: mark NodeFilter Dependent 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
« no previous file with comments | « Source/bindings/tests/results/V8TestInterface.h ('k') | Source/bindings/v8/DOMDataStore.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/tests/results/V8TestInterface.cpp
diff --git a/Source/bindings/tests/results/V8TestInterface.cpp b/Source/bindings/tests/results/V8TestInterface.cpp
index 7e0566fadaf8822f6b17df55c4902269469b3a18..38fce73b0382855020a9296aabf38eeedf979f80 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 {
@@ -778,6 +779,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);
+ 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 */},
« no previous file with comments | « Source/bindings/tests/results/V8TestInterface.h ('k') | Source/bindings/v8/DOMDataStore.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698