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

Unified Diff: Source/bindings/templates/interface.h

Issue 651713002: Oilpan: DOM wrappers don't need to keep persistent handles (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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/core/v8/custom/V8TypedArrayCustom.h ('k') | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/templates/interface.h
diff --git a/Source/bindings/templates/interface.h b/Source/bindings/templates/interface.h
index 8555652a59b8819a56ec8c248949c7f5007a2c55..edfdc4b1042604d9ec6698f35d87b2607353b485 100644
--- a/Source/bindings/templates/interface.h
+++ b/Source/bindings/templates/interface.h
@@ -53,7 +53,16 @@ public:
static const WrapperTypeInfo wrapperTypeInfo;
static void refObject(ScriptWrappableBase* internalPointer);
static void derefObject(ScriptWrappableBase* internalPointer);
- static WrapperPersistentNode* createPersistentHandle(ScriptWrappableBase* internalPointer);
+ static void trace(Visitor* visitor, ScriptWrappableBase* internalPointer)
+ {
+ {% if gc_type == 'GarbageCollectedObject' %}
+ visitor->trace(internalPointer->toImpl<{{cpp_class}}>());
+ {% elif gc_type == 'WillBeGarbageCollectedObject' %}
+#if ENABLE(OILPAN)
+ visitor->trace(internalPointer->toImpl<{{cpp_class}}>());
+#endif
+ {% endif %}
+ }
{% if has_visit_dom_wrapper %}
static void visitDOMWrapper(ScriptWrappableBase* internalPointer, const v8::Persistent<v8::Object>&, v8::Isolate*);
{% endif %}
@@ -134,19 +143,7 @@ public:
FIXME: Remove this internal field, and share one field for either:
* a persistent handle (if the object is in oilpan) or
* a C++ pointer to the DOM object (if the object is not in oilpan) #}
- {% if gc_type == 'GarbageCollectedObject' %}
- static const int persistentHandleIndex = v8DefaultWrapperInternalFieldCount + {{custom_internal_field_counter}};
- static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {{custom_internal_field_counter}} + 1;
- {% elif gc_type == 'WillBeGarbageCollectedObject' %}
-#if ENABLE(OILPAN)
- static const int persistentHandleIndex = v8DefaultWrapperInternalFieldCount + {{custom_internal_field_counter}};
- static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {{custom_internal_field_counter}} + 1;
-#else
- static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {{custom_internal_field_counter}};
-#endif
- {% elif gc_type == 'RefCountedObject' %}
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {{custom_internal_field_counter}};
- {% endif %}
{# End custom internal fields #}
static inline ScriptWrappableBase* toScriptWrappableBase({{cpp_class}}* impl)
{
« no previous file with comments | « Source/bindings/core/v8/custom/V8TypedArrayCustom.h ('k') | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698