| Index: base/trace_event/memory_dump_manager_unittest.cc
|
| diff --git a/base/trace_event/memory_dump_manager_unittest.cc b/base/trace_event/memory_dump_manager_unittest.cc
|
| index 464ca2da48c5e8e6a224668b92e7487946b0cd7e..d2596ae9db9dea1c608e176a240f8da8baaa3b1d 100644
|
| --- a/base/trace_event/memory_dump_manager_unittest.cc
|
| +++ b/base/trace_event/memory_dump_manager_unittest.cc
|
| @@ -370,19 +370,19 @@ TEST_F(MemoryDumpManagerTest, RespectTaskRunnerAffinity) {
|
| InitializeMemoryDumpManager(false /* is_coordinator */);
|
| const uint32 kNumInitialThreads = 8;
|
|
|
| - ScopedVector<Thread> threads;
|
| - ScopedVector<MockMemoryDumpProvider> mdps;
|
| + std::vector<scoped_ptr<Thread>> threads;
|
| + std::vector<scoped_ptr<MockMemoryDumpProvider>> mdps;
|
|
|
| // Create the threads and setup the expectations. Given that at each iteration
|
| // we will pop out one thread/MemoryDumpProvider, each MDP is supposed to be
|
| // invoked a number of times equal to its index.
|
| for (uint32 i = kNumInitialThreads; i > 0; --i) {
|
| - Thread* thread = new Thread("test thread");
|
| - threads.push_back(thread);
|
| - threads.back()->Start();
|
| + threads.push_back(make_scoped_ptr(new Thread("test thread")));
|
| + auto thread = threads.back().get();
|
| + thread->Start();
|
| scoped_refptr<SingleThreadTaskRunner> task_runner = thread->task_runner();
|
| - MockMemoryDumpProvider* mdp = new MockMemoryDumpProvider();
|
| - mdps.push_back(mdp);
|
| + mdps.push_back(make_scoped_ptr(new MockMemoryDumpProvider()));
|
| + auto mdp = mdps.back().get();
|
| RegisterDumpProvider(mdp, task_runner, kDefaultOptions);
|
| EXPECT_CALL(*mdp, OnMemoryDump(_, _))
|
| .Times(i)
|
| @@ -392,7 +392,6 @@ TEST_F(MemoryDumpManagerTest, RespectTaskRunnerAffinity) {
|
| return true;
|
| }));
|
| }
|
| -
|
| EnableTracingWithLegacyCategories(MemoryDumpManager::kTraceCategory);
|
|
|
| while (!threads.empty()) {
|
| @@ -409,7 +408,7 @@ TEST_F(MemoryDumpManagerTest, RespectTaskRunnerAffinity) {
|
| RunLoop run_loop;
|
| Closure unregistration =
|
| Bind(&MemoryDumpManager::UnregisterDumpProvider,
|
| - Unretained(mdm_.get()), Unretained(mdps.back()));
|
| + Unretained(mdm_.get()), Unretained(mdps.back().get()));
|
| threads.back()->task_runner()->PostTaskAndReply(FROM_HERE, unregistration,
|
| run_loop.QuitClosure());
|
| run_loop.Run();
|
|
|