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

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: Pre-emptively GC a long runnning test 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();
haraken 2014/05/12 12:04:13 Shouldn't this be DISALLOW_ALLOCATION()? Collectio
sof 2014/05/12 12:24:36 I suppose it is a value object in collections here
public:
CollectionIndexCache();
@@ -63,6 +64,11 @@ public:
void invalidate();
+ void traceAfterDispatch(Visitor* visitor)
haraken 2014/05/12 12:04:13 Why isn't this trace()?
sof 2014/05/12 12:24:36 With DISALLOW_ALLOCATION() used instead, it should
+ {
+ 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