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

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: 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 d32bdaaa93c22f6fff3fef0e0e10cbfafb72d015..8f6547f9e0c35f4ebf786a3a3e472636ffde8838 100644
--- a/base/trace_event/memory_dump_manager_unittest.cc
+++ b/base/trace_event/memory_dump_manager_unittest.cc
@@ -370,21 +370,21 @@ 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.push_back(make_scoped_ptr(new Thread("test thread")));
Primiano Tucci (use gerrit) 2015/11/26 15:38:02 I honestly did prefer keeping these as separate li
threads.back()->Start();
- scoped_refptr<SingleThreadTaskRunner> task_runner = thread->task_runner();
- MockMemoryDumpProvider* mdp = new MockMemoryDumpProvider();
- mdps.push_back(mdp);
- RegisterDumpProvider(mdp, task_runner, kDefaultOptions);
- EXPECT_CALL(*mdp, OnMemoryDump(_, _))
+ scoped_refptr<SingleThreadTaskRunner> task_runner =
+ threads.back()->task_runner();
+ scoped_ptr<MockMemoryDumpProvider> mdp(new MockMemoryDumpProvider());
+ mdps.push_back(make_scoped_ptr(new MockMemoryDumpProvider()));
+ RegisterDumpProvider(mdps.back().get(), task_runner, kDefaultOptions);
+ EXPECT_CALL(*(mdps.back()), OnMemoryDump(_, _))
.Times(i)
.WillRepeatedly(Invoke(
[task_runner](const MemoryDumpArgs&, ProcessMemoryDump*) -> bool {
@@ -409,7 +409,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