Chromium Code Reviews| 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; |
| } |