CollectionCache: Remove unused copy constructor and make it noncopyable.
authorkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Dec 2011 12:03:37 +0000 (12:03 +0000)
committerkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Dec 2011 12:03:37 +0000 (12:03 +0000)
<http://webkit.org/b/74378>

Reviewed by Simon Hausmann.

* html/CollectionCache.cpp:
* html/CollectionCache.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@102669 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/CollectionCache.cpp
Source/WebCore/html/CollectionCache.h

index 8dadf78..3306759 100644 (file)
@@ -1,3 +1,13 @@
+2011-12-12  Andreas Kling  <kling@webkit.org>
+
+        CollectionCache: Remove unused copy constructor and make it noncopyable.
+        <http://webkit.org/b/74378>
+
+        Reviewed by Simon Hausmann.
+
+        * html/CollectionCache.cpp:
+        * html/CollectionCache.h:
+
 2011-12-13  Jarred Nicholls  <jarred@sencha.com>
 
         XHR should use m_responseTypeCode internally to be consistent with WebKit coding style
index 9db2a09..07dc76c 100644 (file)
@@ -32,42 +32,6 @@ CollectionCache::CollectionCache()
     reset();
 }
 
-inline void CollectionCache::copyCacheMap(NodeCacheMap& dest, const NodeCacheMap& src)
-{
-    ASSERT(dest.isEmpty());
-    NodeCacheMap::const_iterator end = src.end();
-    for (NodeCacheMap::const_iterator it = src.begin(); it != end; ++it)
-        dest.add(it->first, adoptPtr(new Vector<Element*>(*it->second)));
-}
-
-CollectionCache::CollectionCache(const CollectionCache& other)
-    : version(other.version)
-    , current(other.current)
-    , position(other.position)
-    , length(other.length)
-    , elementsArrayPosition(other.elementsArrayPosition)
-    , hasLength(other.hasLength)
-    , hasNameCache(other.hasNameCache)
-{
-    copyCacheMap(idCache, other.idCache);
-    copyCacheMap(nameCache, other.nameCache);
-}
-
-void CollectionCache::swap(CollectionCache& other)
-{
-    std::swap(version, other.version);
-    std::swap(current, other.current);
-    std::swap(position, other.position);
-    std::swap(length, other.length);
-    std::swap(elementsArrayPosition, other.elementsArrayPosition);
-
-    idCache.swap(other.idCache);
-    nameCache.swap(other.nameCache);
-    
-    std::swap(hasLength, other.hasLength);
-    std::swap(hasNameCache, other.hasNameCache);
-}
-
 void CollectionCache::reset()
 {
     current = 0;
index c804357..2fddb55 100644 (file)
@@ -30,19 +30,11 @@ namespace WebCore {
 class Element;
 
 struct CollectionCache {
-    WTF_MAKE_FAST_ALLOCATED;
+    WTF_MAKE_FAST_ALLOCATED; WTF_MAKE_NONCOPYABLE(CollectionCache);
 public:
     CollectionCache();
-    CollectionCache(const CollectionCache&);
-    CollectionCache& operator=(const CollectionCache& other)
-    {
-        CollectionCache tmp(other);    
-        swap(tmp);
-        return *this;
-    }
 
     void reset();
-    void swap(CollectionCache&);
 
     void checkConsistency();
 
@@ -57,9 +49,6 @@ public:
     NodeCacheMap nameCache;
     bool hasLength;
     bool hasNameCache;
-
-private:
-    static void copyCacheMap(NodeCacheMap&, const NodeCacheMap&);
 };
 
 void append(CollectionCache::NodeCacheMap&, const AtomicString&, Element*);