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

Unified Diff: webrtc/base/criticalsection_unittest.cc

Issue 2808463002: Delete class ScopedPtrCollection. Replaced with vector of unique_ptr. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/BUILD.gn ('k') | webrtc/base/scopedptrcollection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/criticalsection_unittest.cc
diff --git a/webrtc/base/criticalsection_unittest.cc b/webrtc/base/criticalsection_unittest.cc
index 42679d987f4a6cfec4daa5007e1ee5d43c922374..a16f4f2d4f5809ab5133ecd7fe2ec42dde27e029 100644
--- a/webrtc/base/criticalsection_unittest.cc
+++ b/webrtc/base/criticalsection_unittest.cc
@@ -18,7 +18,6 @@
#include "webrtc/base/event.h"
#include "webrtc/base/gunit.h"
#include "webrtc/base/platform_thread.h"
-#include "webrtc/base/scopedptrcollection.h"
#include "webrtc/base/thread.h"
namespace rtc {
@@ -199,13 +198,13 @@ struct CompareAndSwapOp {
static int AtomicOp(int* i) { return AtomicOps::CompareAndSwap(i, 0, 1); }
};
-void StartThreads(ScopedPtrCollection<Thread>* threads,
+void StartThreads(std::vector<std::unique_ptr<Thread>>* threads,
MessageHandler* handler) {
for (int i = 0; i < kNumThreads; ++i) {
- Thread* thread = new Thread();
+ std::unique_ptr<Thread> thread(new Thread());
thread->Start();
thread->Post(RTC_FROM_HERE, handler);
- threads->PushBack(thread);
+ threads->push_back(std::move(thread));
}
}
@@ -248,7 +247,7 @@ TEST(AtomicOpsTest, SimplePtr) {
TEST(AtomicOpsTest, Increment) {
// Create and start lots of threads.
AtomicOpRunner<IncrementOp, UniqueValueVerifier> runner(0);
- ScopedPtrCollection<Thread> threads;
+ std::vector<std::unique_ptr<Thread>> threads;
StartThreads(&threads, &runner);
runner.SetExpectedThreadCount(kNumThreads);
@@ -261,7 +260,7 @@ TEST(AtomicOpsTest, Decrement) {
// Create and start lots of threads.
AtomicOpRunner<DecrementOp, UniqueValueVerifier> runner(
kOperationsToRun * kNumThreads);
- ScopedPtrCollection<Thread> threads;
+ std::vector<std::unique_ptr<Thread>> threads;
StartThreads(&threads, &runner);
runner.SetExpectedThreadCount(kNumThreads);
@@ -273,7 +272,7 @@ TEST(AtomicOpsTest, Decrement) {
TEST(AtomicOpsTest, CompareAndSwap) {
// Create and start lots of threads.
AtomicOpRunner<CompareAndSwapOp, CompareAndSwapVerifier> runner(0);
- ScopedPtrCollection<Thread> threads;
+ std::vector<std::unique_ptr<Thread>> threads;
StartThreads(&threads, &runner);
runner.SetExpectedThreadCount(kNumThreads);
@@ -285,7 +284,7 @@ TEST(AtomicOpsTest, CompareAndSwap) {
TEST(GlobalLockTest, Basic) {
// Create and start lots of threads.
LockRunner<GlobalLock> runner;
- ScopedPtrCollection<Thread> threads;
+ std::vector<std::unique_ptr<Thread>> threads;
StartThreads(&threads, &runner);
runner.SetExpectedThreadCount(kNumThreads);
@@ -297,7 +296,7 @@ TEST(GlobalLockTest, Basic) {
TEST(CriticalSectionTest, Basic) {
// Create and start lots of threads.
LockRunner<CriticalSectionLock> runner;
- ScopedPtrCollection<Thread> threads;
+ std::vector<std::unique_ptr<Thread>> threads;
StartThreads(&threads, &runner);
runner.SetExpectedThreadCount(kNumThreads);
« no previous file with comments | « webrtc/base/BUILD.gn ('k') | webrtc/base/scopedptrcollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698