Chromium Code Reviews| Index: Source/bindings/v8/WrapperTypeInfo.h |
| diff --git a/Source/bindings/v8/WrapperTypeInfo.h b/Source/bindings/v8/WrapperTypeInfo.h |
| index 3839e5b2dcf7f84de1bb6d69aa50f91f7b4c50ed..98ad2437f7c797f752773370cc8087ffdfcb3a2c 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>& wrapper, v8::Isolate*); |
|
haraken
2013/10/17 03:28:22
|wrapper| is not needed.
kouhei (in TOK)
2013/10/17 05:17:23
Done.
|
| typedef void (*InstallPerContextPrototypePropertiesFunction)(v8::Handle<v8::Object>, v8::Isolate*); |
| enum WrapperTypePrototype { |
| @@ -68,6 +68,12 @@ namespace WebCore { |
| WrapperTypeErrorPrototype |
| }; |
| + inline void setObjectGroup(void* object, const v8::Persistent<v8::Object>& wrapper, v8::Isolate* isolate) |
| + { |
| + // FIXME: remove reinterpret_cast after http://crrev.com/27512003 has rolled. |
| + isolate->SetObjectGroupId(reinterpret_cast<const v8::Persistent<v8::Value>&>(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 +128,19 @@ namespace WebCore { |
| return toEventTargetFunction(object); |
| } |
| - void* opaqueRootForGC(void* object, v8::Isolate* isolate) |
| + void resolveWrapperReachability(void* object, const v8::Persistent<v8::Object>& wrapper, v8::Isolate* isolate) |
| { |
| - 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 InstallPerContextPrototypePropertiesFunction installPerContextPrototypePropertiesFunction; |
| const WrapperTypeInfo* parentClass; |
| const WrapperTypePrototype wrapperTypePrototype; |