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

Unified Diff: base/trace_event/memory_dump_manager_unittest.cc

Issue 1459473006: Remove ScopedVector from memory_dump_manager_unittest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean Created 5 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698