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

Side by Side Diff: Source/core/html/CollectionIndexCache.h

Issue 326073003: Reduce size of HTMLCollection / LiveNodeList / ChildNodeList by 1 word (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
3 * Copyright (C) 2014 Samsung Electronics. All rights reserved. 3 * Copyright (C) 2014 Samsung Electronics. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 ALWAYS_INLINE bool isCachedNodeCountValid() const { return m_isLengthCacheVa lid; } 85 ALWAYS_INLINE bool isCachedNodeCountValid() const { return m_isLengthCacheVa lid; }
86 ALWAYS_INLINE unsigned cachedNodeCount() const { return m_cachedNodeCount; } 86 ALWAYS_INLINE unsigned cachedNodeCount() const { return m_cachedNodeCount; }
87 ALWAYS_INLINE void setCachedNodeCount(unsigned length) 87 ALWAYS_INLINE void setCachedNodeCount(unsigned length)
88 { 88 {
89 m_cachedNodeCount = length; 89 m_cachedNodeCount = length;
90 m_isLengthCacheValid = true; 90 m_isLengthCacheValid = true;
91 } 91 }
92 92
93 RawPtrWillBeMember<NodeType> m_currentNode; 93 RawPtrWillBeMember<NodeType> m_currentNode;
94 unsigned m_cachedNodeCount; 94 unsigned m_cachedNodeCount;
95 unsigned m_cachedNodeIndex; 95 unsigned m_cachedNodeIndex : 31;
96 unsigned m_isLengthCacheValid : 1; 96 unsigned m_isLengthCacheValid : 1;
97 }; 97 };
98 98
99 template <typename Collection, typename NodeType> 99 template <typename Collection, typename NodeType>
100 CollectionIndexCache<Collection, NodeType>::CollectionIndexCache() 100 CollectionIndexCache<Collection, NodeType>::CollectionIndexCache()
101 : m_currentNode(nullptr) 101 : m_currentNode(nullptr)
102 , m_cachedNodeCount(0) 102 , m_cachedNodeCount(0)
103 , m_cachedNodeIndex(0) 103 , m_cachedNodeIndex(0)
104 , m_isLengthCacheValid(false) 104 , m_isLengthCacheValid(false)
105 { 105 {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 setCachedNodeCount(currentIndex + 1); 199 setCachedNodeCount(currentIndex + 1);
200 return 0; 200 return 0;
201 } 201 }
202 setCachedNode(currentNode, currentIndex); 202 setCachedNode(currentNode, currentIndex);
203 return currentNode; 203 return currentNode;
204 } 204 }
205 205
206 } // namespace WebCore 206 } // namespace WebCore
207 207
208 #endif // CollectionIndexCache_h 208 #endif // CollectionIndexCache_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698