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

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: setNativeInfoForInnerGlobalObject() -> setNativeInfoForHiddenWrapper() 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
« no previous file with comments | « Source/bindings/v8/Dictionary.cpp ('k') | Source/bindings/v8/V8WindowShell.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8DOMWrapper.h
diff --git a/Source/bindings/v8/V8DOMWrapper.h b/Source/bindings/v8/V8DOMWrapper.h
index 589599613bd9f94db0b21463db2470d7bfccc05f..5e8a0dadfc5205d57da4b33107909d3fdf7ca083 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*);
+ static inline void setNativeInfoForHiddenWrapper(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,22 @@ struct WrapperTypeInfo;
wrapper->SetAlignedPointerInInternalField(v8DOMWrapperTypeIndex, const_cast<WrapperTypeInfo*>(type));
}
+ inline void V8DOMWrapper::setNativeInfoForHiddenWrapper(v8::Handle<v8::Object> wrapper, const WrapperTypeInfo* type, void* object)
+ {
+ // see V8WindowShell::installDOMWindow() comment for why this version is needed and safe.
+ 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));
+ // Clear out the last internal field, which is assumed to contain a valid persistent pointer value.
+ wrapper->SetAlignedPointerInInternalField(wrapper->InternalFieldCount() - 1, 0);
+ }
+
+
inline void V8DOMWrapper::setNativeInfoWithPersistentHandle(v8::Handle<v8::Object> wrapper, const WrapperTypeInfo* type, void* object, PersistentNode* handle)
{
ASSERT(wrapper->InternalFieldCount() >= 3);
« no previous file with comments | « Source/bindings/v8/Dictionary.cpp ('k') | Source/bindings/v8/V8WindowShell.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698