Index: Source/core/dom/NodeRareData.cpp |
diff --git a/Source/core/dom/NodeRareData.cpp b/Source/core/dom/NodeRareData.cpp |
index c29894c2a00a5f2807675c7d17679ae65a955043..a347406ea4fee114bd1888840e92a84bd99935df 100644 |
--- a/Source/core/dom/NodeRareData.cpp |
+++ b/Source/core/dom/NodeRareData.cpp |
@@ -58,9 +58,33 @@ void NodeListsNodeData::invalidateCaches(const QualifiedName* attrName) |
it->value->invalidateCache(); |
} |
+#if ENABLE(OILPAN) |
+void NodeListsNodeData::clearWeakMembers(Visitor* visitor) |
+{ |
+ if (m_childNodeList && !visitor->isAlive(m_childNodeList)) |
haraken
2014/05/20 09:27:33
Nit: You don't need to check m_childNodeList.
|
+ m_childNodeList.clear(); |
+ if (!m_childNodeList && !m_atomicNameCaches.size() && !m_tagCollectionCacheNS.size()) |
+ m_owner->clearNodeLists(); |
+} |
+#endif |
+ |
+void NodeListsNodeData::trace(Visitor* visitor) |
+{ |
+#if ENABLE(OILPAN) |
Erik Corry
2014/05/20 09:09:48
An alternative (I think simpler) way to do this wo
sof
2014/05/20 09:54:57
I like this,it just fits better all around to move
|
+ visitor->trace(m_atomicNameCaches); |
+ visitor->trace(m_tagCollectionCacheNS); |
+ visitor->trace(m_owner); |
+ // NOTE: The m_childNodeList weak member is manually updated in |
+ // clearWeakMembers() above hence not traced as a weak member |
+ // here. |
+ visitor->registerWeakMembers<NodeListsNodeData, &NodeListsNodeData::clearWeakMembers>(this); |
+#endif |
+} |
+ |
void NodeRareData::traceAfterDispatch(Visitor* visitor) |
{ |
visitor->trace(m_mutationObserverData); |
+ visitor->trace(m_nodeLists); |
} |
void NodeRareData::trace(Visitor* visitor) |