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

Side by Side Diff: third_party/WebKit/Source/wtf/DequeTest.cpp

Issue 2011813002: Rename OwnPtr::clear() to reset() in wtf/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/HashMapTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 EXPECT_EQ(1, deque.first()->get()); 211 EXPECT_EQ(1, deque.first()->get());
212 EXPECT_EQ(1u, deque.size()); 212 EXPECT_EQ(1u, deque.size());
213 EXPECT_EQ(1, destructNumber); 213 EXPECT_EQ(1, destructNumber);
214 214
215 OwnPtr<DestructCounter> ownCounter1 = std::move(deque.first()); 215 OwnPtr<DestructCounter> ownCounter1 = std::move(deque.first());
216 deque.removeFirst(); 216 deque.removeFirst();
217 EXPECT_EQ(counter1, ownCounter1->get()); 217 EXPECT_EQ(counter1, ownCounter1->get());
218 EXPECT_EQ(0u, deque.size()); 218 EXPECT_EQ(0u, deque.size());
219 EXPECT_EQ(1, destructNumber); 219 EXPECT_EQ(1, destructNumber);
220 220
221 ownCounter1.clear(); 221 ownCounter1.reset();
222 EXPECT_EQ(2, destructNumber); 222 EXPECT_EQ(2, destructNumber);
223 223
224 size_t count = 1025; 224 size_t count = 1025;
225 destructNumber = 0; 225 destructNumber = 0;
226 for (size_t i = 0; i < count; ++i) 226 for (size_t i = 0; i < count; ++i)
227 deque.prepend(adoptPtr(new DestructCounter(i, &destructNumber))); 227 deque.prepend(adoptPtr(new DestructCounter(i, &destructNumber)));
228 228
229 // Deque relocation must not destruct OwnPtr element. 229 // Deque relocation must not destruct OwnPtr element.
230 EXPECT_EQ(0, destructNumber); 230 EXPECT_EQ(0, destructNumber);
231 EXPECT_EQ(count, deque.size()); 231 EXPECT_EQ(count, deque.size());
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 EXPECT_EQ(0, counter); 602 EXPECT_EQ(0, counter);
603 603
604 counter = 0; 604 counter = 0;
605 Deque<CountCopy, 1> yetAnother(std::move(deque)); // Move construction. 605 Deque<CountCopy, 1> yetAnother(std::move(deque)); // Move construction.
606 EXPECT_EQ(0, counter); 606 EXPECT_EQ(0, counter);
607 } 607 }
608 608
609 } // anonymous namespace 609 } // anonymous namespace
610 610
611 } // namespace WTF 611 } // namespace WTF
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/HashMapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698