X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fwtf%2FLinkedHashSet.h;h=e254e150403720916588561a9a0b7b989e819a43;hb=3545e9f2671f595d2a2f3ee75ca0393b01e35ef6;hp=b0a5859285fb5b8eb014a7a96f674da823798925;hpb=7d210d4c7e9ba36e635eabc5b5780495f8a63292;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/wtf/LinkedHashSet.h b/src/third_party/WebKit/Source/wtf/LinkedHashSet.h index b0a5859..e254e15 100644 --- a/src/third_party/WebKit/Source/wtf/LinkedHashSet.h +++ b/src/third_party/WebKit/Source/wtf/LinkedHashSet.h @@ -45,9 +45,9 @@ template class LinkedHashSetConstIterator; template class LinkedHashSetReverseIterator; template class LinkedHashSetConstReverseIterator; -template struct LinkedHashSetTranslator; -template struct LinkedHashSetExtractor; -template struct LinkedHashSetTraits; +template struct LinkedHashSetTranslator; +template struct LinkedHashSetExtractor; +template struct LinkedHashSetTraits; class LinkedHashSetNodeBase { public: @@ -116,7 +116,7 @@ private: LinkedHashSetNodeBase& operator=(const LinkedHashSetNodeBase& other); }; -template +template class LinkedHashSetNode : public LinkedHashSetNodeBase { public: LinkedHashSetNode(const ValueArg& value, LinkedHashSetNodeBase* prev, LinkedHashSetNodeBase* next) @@ -142,10 +142,10 @@ class LinkedHashSet { private: typedef ValueArg Value; typedef TraitsArg Traits; - typedef LinkedHashSetNode Node; + typedef LinkedHashSetNode Node; typedef LinkedHashSetNodeBase NodeBase; - typedef LinkedHashSetTranslator NodeHashFunctions; - typedef LinkedHashSetTraits NodeHashTraits; + typedef LinkedHashSetTranslator NodeHashFunctions; + typedef LinkedHashSetTraits NodeHashTraits; typedef HashTable ImplType; @@ -267,9 +267,9 @@ private: NodeBase m_anchor; }; -template +template struct LinkedHashSetTranslator { - typedef LinkedHashSetNode Node; + typedef LinkedHashSetNode Node; typedef LinkedHashSetNodeBase NodeBase; typedef typename HashTraits::PeekInType ValuePeekInType; static unsigned hash(const Node& node) { return HashFunctions::hash(node.m_value); } @@ -278,8 +278,8 @@ struct LinkedHashSetTranslator { static bool equal(const Node& a, const Node& b) { return HashFunctions::equal(a.m_value, b.m_value); } static void translate(Node& location, ValuePeekInType key, NodeBase* anchor) { - location.m_value = key; anchor->insertBefore(location); + location.m_value = key; } // Empty (or deleted) slots have the m_next pointer set to null, but we @@ -289,14 +289,14 @@ struct LinkedHashSetTranslator { static const bool safeToCompareToEmptyOrDeleted = false; }; -template +template struct LinkedHashSetExtractor { - static const Value& extract(const LinkedHashSetNode& node) { return node.m_value; } + static const Value& extract(const LinkedHashSetNode& node) { return node.m_value; } }; -template -struct LinkedHashSetTraits : public SimpleClassHashTraits > { - typedef LinkedHashSetNode Node; +template +struct LinkedHashSetTraits : public SimpleClassHashTraits > { + typedef LinkedHashSetNode Node; typedef ValueTraitsArg ValueTraits; // The slot is empty when the m_next field is zero so it's safe to zero @@ -308,7 +308,7 @@ struct LinkedHashSetTraits : public SimpleClassHashTraits(deletedValue); } + static void constructDeletedValue(Node& slot, bool) { slot.m_next = reinterpret_cast(deletedValue); } static bool isDeletedValue(const Node& slot) { return slot.m_next == reinterpret_cast(deletedValue); } // We always need to call destructors, that's how we get linked and @@ -705,13 +705,14 @@ inline void swap(LinkedHashSetNodeBase& a, LinkedHashSetNodeBase& b) } } -template -inline void swap(LinkedHashSetNode& a, LinkedHashSetNode& b) +template +inline void swap(LinkedHashSetNode& a, LinkedHashSetNode& b) { typedef LinkedHashSetNodeBase Base; - + Allocator::enterNoAllocationScope(); swap(static_cast(a), static_cast(b)); swap(a.m_value, b.m_value); + Allocator::leaveNoAllocationScope(); } // Warning: After and while calling this you have a collection with deleted