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

Unified Diff: Source/bindings/v8/WrapperTypeInfo.h

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/v8/V8GCController.cpp ('k') | Source/bindings/v8/custom/V8NodeIteratorCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/WrapperTypeInfo.h
diff --git a/Source/bindings/v8/WrapperTypeInfo.h b/Source/bindings/v8/WrapperTypeInfo.h
index 9b7a3aa2b0ab8adc37ef9b1ad264df20eeab8825..97d1dd0460aff093b85fe35ab35fea5a4817dd65 100644
--- a/Source/bindings/v8/WrapperTypeInfo.h
+++ b/Source/bindings/v8/WrapperTypeInfo.h
@@ -60,7 +60,7 @@ namespace WebCore {
typedef void (*DerefObjectFunction)(void*);
typedef ActiveDOMObject* (*ToActiveDOMObjectFunction)(v8::Handle<v8::Object>);
typedef EventTarget* (*ToEventTargetFunction)(v8::Handle<v8::Object>);
- typedef void* (*OpaqueRootForGC)(void*, v8::Isolate*);
+ typedef void (*ResolveWrapperReachabilityFunction)(void*, const v8::Persistent<v8::Object>&, v8::Isolate*);
typedef void (*InstallPerContextEnabledPrototypePropertiesFunction)(v8::Handle<v8::Object>, v8::Isolate*);
enum WrapperTypePrototype {
@@ -68,6 +68,11 @@ namespace WebCore {
WrapperTypeErrorPrototype
};
+ inline void setObjectGroup(void* object, const v8::Persistent<v8::Object>& wrapper, v8::Isolate* isolate)
+ {
+ isolate->SetObjectGroupId(wrapper, v8::UniqueId(reinterpret_cast<intptr_t>(object)));
+ }
+
// This struct provides a way to store a bunch of information that is helpful when unwrapping
// v8 objects. Each v8 bindings class has exactly one static WrapperTypeInfo member, so
// comparing pointers is a safe way to determine if types match.
@@ -122,18 +127,19 @@ namespace WebCore {
return toEventTargetFunction(object);
}
- void* opaqueRootForGC(void* object, v8::Isolate* isolate) const
+ void resolveWrapperReachability(void* object, const v8::Persistent<v8::Object>& wrapper, v8::Isolate* isolate) const
{
- if (!opaqueRootForGCFunction)
- return object;
- return opaqueRootForGCFunction(object, isolate);
+ if (!resolveWrapperReachabilityFunction)
+ setObjectGroup(object, wrapper, isolate);
+ else
+ resolveWrapperReachabilityFunction(object, wrapper, isolate);
}
const GetTemplateFunction getTemplateFunction;
const DerefObjectFunction derefObjectFunction;
const ToActiveDOMObjectFunction toActiveDOMObjectFunction;
const ToEventTargetFunction toEventTargetFunction;
- const OpaqueRootForGC opaqueRootForGCFunction;
+ const ResolveWrapperReachabilityFunction resolveWrapperReachabilityFunction;
const InstallPerContextEnabledPrototypePropertiesFunction installPerContextEnabledPrototypePropertiesFunction;
const WrapperTypeInfo* parentClass;
const WrapperTypePrototype wrapperTypePrototype;
« no previous file with comments | « Source/bindings/v8/V8GCController.cpp ('k') | Source/bindings/v8/custom/V8NodeIteratorCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698