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

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

Issue 1984593002: Remove OwnPtr::release() calls in web/ & wtf/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with trunk. 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) 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 ++it; 205 ++it;
206 } 206 }
207 EXPECT_EQ(0, destructNumber); 207 EXPECT_EQ(0, destructNumber);
208 208
209 EXPECT_EQ(0, deque.first()->get()); 209 EXPECT_EQ(0, deque.first()->get());
210 deque.removeFirst(); 210 deque.removeFirst();
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 = deque.first().release(); 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.clear();
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;
(...skipping 376 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 | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | third_party/WebKit/Source/wtf/VectorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698