Index: webrtc/base/criticalsection_unittest.cc |
diff --git a/webrtc/base/criticalsection_unittest.cc b/webrtc/base/criticalsection_unittest.cc |
index a16f4f2d4f5809ab5133ecd7fe2ec42dde27e029..42679d987f4a6cfec4daa5007e1ee5d43c922374 100644 |
--- a/webrtc/base/criticalsection_unittest.cc |
+++ b/webrtc/base/criticalsection_unittest.cc |
@@ -18,6 +18,7 @@ |
#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 { |
@@ -198,13 +199,13 @@ |
static int AtomicOp(int* i) { return AtomicOps::CompareAndSwap(i, 0, 1); } |
}; |
-void StartThreads(std::vector<std::unique_ptr<Thread>>* threads, |
+void StartThreads(ScopedPtrCollection<Thread>* threads, |
MessageHandler* handler) { |
for (int i = 0; i < kNumThreads; ++i) { |
- std::unique_ptr<Thread> thread(new Thread()); |
+ Thread* thread = new Thread(); |
thread->Start(); |
thread->Post(RTC_FROM_HERE, handler); |
- threads->push_back(std::move(thread)); |
+ threads->PushBack(thread); |
} |
} |
@@ -247,7 +248,7 @@ |
TEST(AtomicOpsTest, Increment) { |
// Create and start lots of threads. |
AtomicOpRunner<IncrementOp, UniqueValueVerifier> runner(0); |
- std::vector<std::unique_ptr<Thread>> threads; |
+ ScopedPtrCollection<Thread> threads; |
StartThreads(&threads, &runner); |
runner.SetExpectedThreadCount(kNumThreads); |
@@ -260,7 +261,7 @@ |
// Create and start lots of threads. |
AtomicOpRunner<DecrementOp, UniqueValueVerifier> runner( |
kOperationsToRun * kNumThreads); |
- std::vector<std::unique_ptr<Thread>> threads; |
+ ScopedPtrCollection<Thread> threads; |
StartThreads(&threads, &runner); |
runner.SetExpectedThreadCount(kNumThreads); |
@@ -272,7 +273,7 @@ |
TEST(AtomicOpsTest, CompareAndSwap) { |
// Create and start lots of threads. |
AtomicOpRunner<CompareAndSwapOp, CompareAndSwapVerifier> runner(0); |
- std::vector<std::unique_ptr<Thread>> threads; |
+ ScopedPtrCollection<Thread> threads; |
StartThreads(&threads, &runner); |
runner.SetExpectedThreadCount(kNumThreads); |
@@ -284,7 +285,7 @@ |
TEST(GlobalLockTest, Basic) { |
// Create and start lots of threads. |
LockRunner<GlobalLock> runner; |
- std::vector<std::unique_ptr<Thread>> threads; |
+ ScopedPtrCollection<Thread> threads; |
StartThreads(&threads, &runner); |
runner.SetExpectedThreadCount(kNumThreads); |
@@ -296,7 +297,7 @@ |
TEST(CriticalSectionTest, Basic) { |
// Create and start lots of threads. |
LockRunner<CriticalSectionLock> runner; |
- std::vector<std::unique_ptr<Thread>> threads; |
+ ScopedPtrCollection<Thread> threads; |
StartThreads(&threads, &runner); |
runner.SetExpectedThreadCount(kNumThreads); |