Remove C::swap(C*) where C = Hash{Map,Set}<T>.
Remove the swap() method over non-reference hash sets and
map arguments, along with their curious OtherType indirection,
the methods aren't of real use.
R=
BUG=
Review-Url: https://codereview.chromium.org/1979843002
Cr-Commit-Position: refs/heads/master@{#393770}
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
index 2055922e..7a48e0e 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
@@ -638,7 +638,7 @@
if (!m_invalidatedDocuments.size())
return;
HeapHashSet<Member<Document>> invalidatedDocuments;
- m_invalidatedDocuments.swap(&invalidatedDocuments);
+ m_invalidatedDocuments.swap(invalidatedDocuments);
for (Document* document: invalidatedDocuments)
updateActiveStyleSheets(document, ExistingFrontendRefresh);
}
diff --git a/third_party/WebKit/Source/platform/heap/HeapAllocator.h b/third_party/WebKit/Source/platform/heap/HeapAllocator.h
index 8fa22d8..73a9c00 100644
--- a/third_party/WebKit/Source/platform/heap/HeapAllocator.h
+++ b/third_party/WebKit/Source/platform/heap/HeapAllocator.h
@@ -162,22 +162,6 @@
}
#endif
- template<typename T>
- struct ResultType {
- using Type = T*;
- };
-
- template<typename T>
- struct OtherType {
- using Type = T*;
- };
-
- template<typename T>
- static T& getOther(T* other)
- {
- return *other;
- }
-
static void enterGCForbiddenScope()
{
ThreadState::current()->enterGCForbiddenScope();
diff --git a/third_party/WebKit/Source/platform/heap/HeapTest.cpp b/third_party/WebKit/Source/platform/heap/HeapTest.cpp
index 0e6147d8..5adcc2b 100644
--- a/third_party/WebKit/Source/platform/heap/HeapTest.cpp
+++ b/third_party/WebKit/Source/platform/heap/HeapTest.cpp
@@ -2779,7 +2779,7 @@
set2->swap(cset2);
set->swap(cset2);
cset1.swap(cset2);
- cset2.swap(set2);
+ cset2.swap(*set2);
MemberCountedSet& cCountedSet = container->set3;
set3->swap(cCountedSet);
@@ -2787,10 +2787,10 @@
set3->swap(cCountedSet);
// Triple swap.
- container->map.swap(memberMember2);
+ container->map.swap(*memberMember2);
MemberMember& containedMap = container->map;
memberMember3->swap(containedMap);
- memberMember3->swap(memberMember);
+ memberMember3->swap(*memberMember);
EXPECT_TRUE(memberMember->get(one) == two);
EXPECT_TRUE(memberMember->get(two) == three);
diff --git a/third_party/WebKit/Source/wtf/HashMap.h b/third_party/WebKit/Source/wtf/HashMap.h
index 16efe2f..77a1a3b1 100644
--- a/third_party/WebKit/Source/wtf/HashMap.h
+++ b/third_party/WebKit/Source/wtf/HashMap.h
@@ -81,12 +81,6 @@
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;
unsigned capacity() const;
void reserveCapacityForSize(unsigned size)
diff --git a/third_party/WebKit/Source/wtf/HashSet.h b/third_party/WebKit/Source/wtf/HashSet.h
index 7b57cbb..7cba178df 100644
--- a/third_party/WebKit/Source/wtf/HashSet.h
+++ b/third_party/WebKit/Source/wtf/HashSet.h
@@ -62,12 +62,6 @@
m_impl.swap(ref.m_impl);
}
- void swap(typename Allocator::template OtherType<HashSet>::Type other)
- {
- HashSet& ref = Allocator::getOther(other);
- m_impl.swap(ref.m_impl);
- }
-
unsigned size() const;
unsigned capacity() const;
bool isEmpty() const;
diff --git a/third_party/WebKit/Source/wtf/allocator/PartitionAllocator.h b/third_party/WebKit/Source/wtf/allocator/PartitionAllocator.h
index 2e0e0a9..e10e16f 100644
--- a/third_party/WebKit/Source/wtf/allocator/PartitionAllocator.h
+++ b/third_party/WebKit/Source/wtf/allocator/PartitionAllocator.h
@@ -127,17 +127,6 @@
static bool isAllocationAllowed() { return true; }
- template<typename T>
- struct OtherType {
- typedef T* Type;
- };
-
- template<typename T>
- static T& getOther(T* other)
- {
- return *other;
- }
-
static void enterGCForbiddenScope() { }
static void leaveGCForbiddenScope() { }