Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / wtf / HashMap.h
index 3943384..4577217 100644 (file)
@@ -68,7 +68,7 @@ namespace WTF {
         void operator delete[](void* p) { Allocator::deleteArray(p); }
         void* operator new(size_t, NotNullTag, void* location)
         {
-            ASSERT(!Allocator::isGarbageCollected);
+            COMPILE_ASSERT(!Allocator::isGarbageCollected, Garbage_collector_must_be_disabled);
             ASSERT(location);
             return location;
         }
@@ -94,9 +94,15 @@ namespace WTF {
         typedef typename HashTableType::AddResult AddResult;
 
     public:
-        void swap(HashMap& other)
+        void swap(HashMap& ref)
         {
-            m_impl.swap(other.m_impl);
+            m_impl.swap(ref.m_impl);
+        }
+
+        void swap(typename Allocator::template OtherType<HashMap>::Type other)
+        {
+            HashMap& ref = Allocator::getOther(other);
+            m_impl.swap(ref.m_impl);
         }
 
         unsigned size() const;
@@ -370,7 +376,7 @@ namespace WTF {
         AddResult result = inlineAdd(key, mapped);
         if (!result.isNewEntry) {
             // The inlineAdd call above found an existing hash table entry; we need to set the mapped value.
-            MappedTraits::store(mapped, result.iterator->value);
+            MappedTraits::store(mapped, result.storedValue->value);
         }
         return result;
     }