Changeset 102669 in webkit
- Timestamp:
- Dec 13, 2011 4:03:37 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r102665 r102669 1 2011-12-12 Andreas Kling <kling@webkit.org> 2 3 CollectionCache: Remove unused copy constructor and make it noncopyable. 4 <http://webkit.org/b/74378> 5 6 Reviewed by Simon Hausmann. 7 8 * html/CollectionCache.cpp: 9 * html/CollectionCache.h: 10 1 11 2011-12-13 Jarred Nicholls <jarred@sencha.com> 2 12 -
trunk/Source/WebCore/html/CollectionCache.cpp
r102147 r102669 33 33 } 34 34 35 inline void CollectionCache::copyCacheMap(NodeCacheMap& dest, const NodeCacheMap& src)36 {37 ASSERT(dest.isEmpty());38 NodeCacheMap::const_iterator end = src.end();39 for (NodeCacheMap::const_iterator it = src.begin(); it != end; ++it)40 dest.add(it->first, adoptPtr(new Vector<Element*>(*it->second)));41 }42 43 CollectionCache::CollectionCache(const CollectionCache& other)44 : version(other.version)45 , current(other.current)46 , position(other.position)47 , length(other.length)48 , elementsArrayPosition(other.elementsArrayPosition)49 , hasLength(other.hasLength)50 , hasNameCache(other.hasNameCache)51 {52 copyCacheMap(idCache, other.idCache);53 copyCacheMap(nameCache, other.nameCache);54 }55 56 void CollectionCache::swap(CollectionCache& other)57 {58 std::swap(version, other.version);59 std::swap(current, other.current);60 std::swap(position, other.position);61 std::swap(length, other.length);62 std::swap(elementsArrayPosition, other.elementsArrayPosition);63 64 idCache.swap(other.idCache);65 nameCache.swap(other.nameCache);66 67 std::swap(hasLength, other.hasLength);68 std::swap(hasNameCache, other.hasNameCache);69 }70 71 35 void CollectionCache::reset() 72 36 { -
trunk/Source/WebCore/html/CollectionCache.h
r102147 r102669 31 31 32 32 struct CollectionCache { 33 WTF_MAKE_FAST_ALLOCATED; 33 WTF_MAKE_FAST_ALLOCATED; WTF_MAKE_NONCOPYABLE(CollectionCache); 34 34 public: 35 35 CollectionCache(); 36 CollectionCache(const CollectionCache&);37 CollectionCache& operator=(const CollectionCache& other)38 {39 CollectionCache tmp(other);40 swap(tmp);41 return *this;42 }43 36 44 37 void reset(); 45 void swap(CollectionCache&);46 38 47 39 void checkConsistency(); … … 58 50 bool hasLength; 59 51 bool hasNameCache; 60 61 private:62 static void copyCacheMap(NodeCacheMap&, const NodeCacheMap&);63 52 }; 64 53
Note: See TracChangeset
for help on using the changeset viewer.