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

Unified Diff: Source/core/html/CollectionIndexCache.h

Issue 280123002: Oilpan: move LiveNodeList collections to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have NodeRareData clear out NodeListsNodeData instead. Created 6 years, 7 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/core/fetch/FontResource.cpp ('k') | Source/core/html/HTMLAllCollection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/CollectionIndexCache.h
diff --git a/Source/core/html/CollectionIndexCache.h b/Source/core/html/CollectionIndexCache.h
index 9898de0cf274d2cf10c7f3d6098b805ff29f8afe..865104ba059bca18e0db99bf67ae0a5a6faef009 100644
--- a/Source/core/html/CollectionIndexCache.h
+++ b/Source/core/html/CollectionIndexCache.h
@@ -38,6 +38,7 @@ namespace WebCore {
template <typename Collection, typename NodeType>
class CollectionIndexCache {
+ DISALLOW_ALLOCATION();
public:
CollectionIndexCache();
@@ -63,6 +64,11 @@ public:
void invalidate();
+ void trace(Visitor* visitor)
+ {
+ visitor->trace(m_currentNode);
+ }
+
private:
NodeType* nodeBeforeCachedNode(const Collection&, unsigned index);
NodeType* nodeAfterCachedNode(const Collection&, unsigned index);
@@ -84,7 +90,7 @@ private:
m_isLengthCacheValid = true;
}
- NodeType* m_currentNode;
+ RawPtrWillBeMember<NodeType> m_currentNode;
unsigned m_cachedNodeCount;
unsigned m_cachedNodeIndex;
unsigned m_isLengthCacheValid : 1;
@@ -92,7 +98,7 @@ private:
template <typename Collection, typename NodeType>
CollectionIndexCache<Collection, NodeType>::CollectionIndexCache()
- : m_currentNode(0)
+ : m_currentNode(nullptr)
, m_cachedNodeCount(0)
, m_cachedNodeIndex(0)
, m_isLengthCacheValid(false)
@@ -102,7 +108,7 @@ CollectionIndexCache<Collection, NodeType>::CollectionIndexCache()
template <typename Collection, typename NodeType>
void CollectionIndexCache<Collection, NodeType>::invalidate()
{
- m_currentNode = 0;
+ m_currentNode = nullptr;
m_isLengthCacheValid = false;
}
« no previous file with comments | « Source/core/fetch/FontResource.cpp ('k') | Source/core/html/HTMLAllCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698