Changeset 102669 in webkit


Ignore:
Timestamp:
Dec 13, 2011 4:03:37 AM (12 years ago)
Author:
kling@webkit.org
Message:

CollectionCache: Remove unused copy constructor and make it noncopyable.
<http://webkit.org/b/74378>

Reviewed by Simon Hausmann.

  • html/CollectionCache.cpp:
  • html/CollectionCache.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r102665 r102669  
     12011-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
    1112011-12-13  Jarred Nicholls  <jarred@sencha.com>
    212
  • trunk/Source/WebCore/html/CollectionCache.cpp

    r102147 r102669  
    3333}
    3434
    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 
    7135void CollectionCache::reset()
    7236{
  • trunk/Source/WebCore/html/CollectionCache.h

    r102147 r102669  
    3131
    3232struct CollectionCache {
    33     WTF_MAKE_FAST_ALLOCATED;
     33    WTF_MAKE_FAST_ALLOCATED; WTF_MAKE_NONCOPYABLE(CollectionCache);
    3434public:
    3535    CollectionCache();
    36     CollectionCache(const CollectionCache&);
    37     CollectionCache& operator=(const CollectionCache& other)
    38     {
    39         CollectionCache tmp(other);   
    40         swap(tmp);
    41         return *this;
    42     }
    4336
    4437    void reset();
    45     void swap(CollectionCache&);
    4638
    4739    void checkConsistency();
     
    5850    bool hasLength;
    5951    bool hasNameCache;
    60 
    61 private:
    62     static void copyCacheMap(NodeCacheMap&, const NodeCacheMap&);
    6352};
    6453
Note: See TracChangeset for help on using the changeset viewer.