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

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: Rebase needed 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
Index: Source/core/html/CollectionIndexCache.h
diff --git a/Source/core/html/CollectionIndexCache.h b/Source/core/html/CollectionIndexCache.h
index 9898de0cf274d2cf10c7f3d6098b805ff29f8afe..d8dd5eec3a4e7632ba8f6ffdb05748dc6f578ff8 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 {
+ ALLOW_ONLY_INLINE_ALLOCATION();
public:
CollectionIndexCache();
@@ -63,6 +64,11 @@ public:
void invalidate();
+ void traceAfterDispatch(Visitor* visitor)
Mads Ager (chromium) 2014/05/15 10:54:24 This is just a non-virtual trace method, so just c
sof 2014/05/15 22:15:57 Yes, now done + switched to DISALLOW_ALLOCATION()
+ {
+ 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;
}

Powered by Google App Engine
This is Rietveld 408576698