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

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

Issue 211373002: Oilpan: move DOMWindow object to the oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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/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);

Powered by Google App Engine
This is Rietveld 408576698