Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Side by Side Diff: third_party/WebKit/Source/platform/heap/HeapTest.cpp

Issue 1979843002: Remove C::swap(C*) where C = Hash{Map,Set}<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: HeapTest compile fixes Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 2761 matching lines...) Expand 10 before | Expand all | Expand 10 after
2772 dequeUW2->swap(cDequeUW); 2772 dequeUW2->swap(cDequeUW);
2773 dequeUW->swap(cDequeUW); 2773 dequeUW->swap(cDequeUW);
2774 2774
2775 // Swap set and set2 in a roundabout way. 2775 // Swap set and set2 in a roundabout way.
2776 MemberSet& cset1 = container->set; 2776 MemberSet& cset1 = container->set;
2777 MemberSet& cset2 = container->set2; 2777 MemberSet& cset2 = container->set2;
2778 set->swap(cset1); 2778 set->swap(cset1);
2779 set2->swap(cset2); 2779 set2->swap(cset2);
2780 set->swap(cset2); 2780 set->swap(cset2);
2781 cset1.swap(cset2); 2781 cset1.swap(cset2);
2782 cset2.swap(set2); 2782 cset2.swap(*set2);
2783 2783
2784 MemberCountedSet& cCountedSet = container->set3; 2784 MemberCountedSet& cCountedSet = container->set3;
2785 set3->swap(cCountedSet); 2785 set3->swap(cCountedSet);
2786 EXPECT_EQ(0u, set3->size()); 2786 EXPECT_EQ(0u, set3->size());
2787 set3->swap(cCountedSet); 2787 set3->swap(cCountedSet);
2788 2788
2789 // Triple swap. 2789 // Triple swap.
2790 container->map.swap(memberMember2); 2790 container->map.swap(*memberMember2);
2791 MemberMember& containedMap = container->map; 2791 MemberMember& containedMap = container->map;
2792 memberMember3->swap(containedMap); 2792 memberMember3->swap(containedMap);
2793 memberMember3->swap(memberMember); 2793 memberMember3->swap(*memberMember);
2794 2794
2795 EXPECT_TRUE(memberMember->get(one) == two); 2795 EXPECT_TRUE(memberMember->get(one) == two);
2796 EXPECT_TRUE(memberMember->get(two) == three); 2796 EXPECT_TRUE(memberMember->get(two) == three);
2797 EXPECT_TRUE(memberMember->get(three) == four); 2797 EXPECT_TRUE(memberMember->get(three) == four);
2798 EXPECT_TRUE(memberMember->get(four) == one); 2798 EXPECT_TRUE(memberMember->get(four) == one);
2799 EXPECT_TRUE(primitiveMember->get(1) == two); 2799 EXPECT_TRUE(primitiveMember->get(1) == two);
2800 EXPECT_TRUE(primitiveMember->get(2) == three); 2800 EXPECT_TRUE(primitiveMember->get(2) == three);
2801 EXPECT_TRUE(primitiveMember->get(3) == four); 2801 EXPECT_TRUE(primitiveMember->get(3) == four);
2802 EXPECT_TRUE(primitiveMember->get(4) == one); 2802 EXPECT_TRUE(primitiveMember->get(4) == one);
2803 EXPECT_EQ(1, memberPrimitive->get(four)); 2803 EXPECT_EQ(1, memberPrimitive->get(four));
(...skipping 3848 matching lines...) Expand 10 before | Expand all | Expand 10 after
6652 conservativelyCollectGarbage(); 6652 conservativelyCollectGarbage();
6653 EXPECT_EQ(wrapper, weakWrapper->value()); 6653 EXPECT_EQ(wrapper, weakWrapper->value());
6654 // Stub out any stack reference. 6654 // Stub out any stack reference.
6655 wrapper = nullptr; 6655 wrapper = nullptr;
6656 } 6656 }
6657 preciselyCollectGarbage(); 6657 preciselyCollectGarbage();
6658 EXPECT_EQ(nullptr, weakWrapper->value()); 6658 EXPECT_EQ(nullptr, weakWrapper->value());
6659 } 6659 }
6660 6660
6661 } // namespace blink 6661 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/HeapAllocator.h ('k') | third_party/WebKit/Source/wtf/HashMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698