Index: Source/bindings/v8/V8DOMWrapper.h |
diff --git a/Source/bindings/v8/V8DOMWrapper.h b/Source/bindings/v8/V8DOMWrapper.h |
index 589599613bd9f94db0b21463db2470d7bfccc05f..8c8e4f3148ead7fca9f9a00d46305e7b840fa3ff 100644 |
--- a/Source/bindings/v8/V8DOMWrapper.h |
+++ b/Source/bindings/v8/V8DOMWrapper.h |
@@ -52,6 +52,7 @@ struct WrapperTypeInfo; |
template<typename V8T, typename T> |
static inline v8::Handle<v8::Object> associateObjectWithWrapper(T*, const WrapperTypeInfo*, v8::Handle<v8::Object>, v8::Isolate*, WrapperConfiguration::Lifetime); |
static inline void setNativeInfo(v8::Handle<v8::Object>, const WrapperTypeInfo*, void*); |
haraken
2014/03/26 08:16:10
Another thing I'm considering is we want to cause
|
+ static inline void setNativeInfoGarbageCollected(v8::Handle<v8::Object>, const WrapperTypeInfo*, void*); |
static inline void setNativeInfoWithPersistentHandle(v8::Handle<v8::Object>, const WrapperTypeInfo*, void*, PersistentNode*); |
static inline void clearNativeInfo(v8::Handle<v8::Object>, const WrapperTypeInfo*); |
@@ -70,6 +71,20 @@ struct WrapperTypeInfo; |
wrapper->SetAlignedPointerInInternalField(v8DOMWrapperTypeIndex, const_cast<WrapperTypeInfo*>(type)); |
} |
+ // Identical to setNativeInfo() but for the "is GCed" assert. |
+ inline void V8DOMWrapper::setNativeInfoGarbageCollected(v8::Handle<v8::Object> wrapper, const WrapperTypeInfo* type, void* object) |
haraken
2014/03/26 01:13:32
The GC interaction between V8 and oilpan is compli
sof
2014/03/26 06:36:46
I did explore that option. Handful of tests were l
Mads Ager (chromium)
2014/03/26 07:29:43
Yeah, the problem with that is that there is only
haraken
2014/03/26 08:07:16
Yeah. Given that DOMWindow is not the only object
sof
2014/03/26 10:42:04
...
|
+ { |
+ ASSERT(wrapper->InternalFieldCount() >= 2); |
+ ASSERT(object); |
+ ASSERT(type); |
+#if ENABLE(OILPAN) |
+ ASSERT(type->isGarbageCollected); |
+#endif |
+ wrapper->SetAlignedPointerInInternalField(v8DOMWrapperObjectIndex, object); |
+ wrapper->SetAlignedPointerInInternalField(v8DOMWrapperTypeIndex, const_cast<WrapperTypeInfo*>(type)); |
+ } |
+ |
+ |
inline void V8DOMWrapper::setNativeInfoWithPersistentHandle(v8::Handle<v8::Object> wrapper, const WrapperTypeInfo* type, void* object, PersistentNode* handle) |
{ |
ASSERT(wrapper->InternalFieldCount() >= 3); |