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

Unified Diff: base/trace_event/memory_dump_manager.cc

Issue 1479473002: base: Use std::move() instead of Pass() for real movable types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: basepass: missing-include 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 | « base/timer/hi_res_timer_manager_unittest.cc ('k') | base/trace_event/trace_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/memory_dump_manager.cc
diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc
index 6f2e8b0f0f953531e84cd860745ec2657c8ad995..e6a1cc3d3d65c576ef57b902708012c985af198e 100644
--- a/base/trace_event/memory_dump_manager.cc
+++ b/base/trace_event/memory_dump_manager.cc
@@ -5,6 +5,7 @@
#include "base/trace_event/memory_dump_manager.h"
#include <algorithm>
+#include <utility>
#include "base/atomic_sequence_num.h"
#include "base/base_switches.h"
@@ -306,7 +307,7 @@ void MemoryDumpManager::CreateProcessDump(const MemoryDumpRequestArgs& args,
// Start the thread hop. |dump_providers_| are kept sorted by thread, so
// ContinueAsyncProcessDump will hop at most once per thread (w.r.t. thread
// affinity specified by the MemoryDumpProvider(s) in RegisterDumpProvider()).
- ContinueAsyncProcessDump(pmd_async_state.Pass());
+ ContinueAsyncProcessDump(std::move(pmd_async_state));
}
// At most one ContinueAsyncProcessDump() can be active at any time for a given
@@ -378,7 +379,7 @@ void MemoryDumpManager::ContinueAsyncProcessDump(
const bool did_post_task = task_runner->PostTask(
FROM_HERE, Bind(&MemoryDumpManager::ContinueAsyncProcessDump,
- Unretained(this), Passed(pmd_async_state.Pass())));
+ Unretained(this), Passed(&pmd_async_state)));
if (did_post_task)
return;
@@ -430,9 +431,9 @@ void MemoryDumpManager::ContinueAsyncProcessDump(
}
if (finalize)
- return FinalizeDumpAndAddToTrace(pmd_async_state.Pass());
+ return FinalizeDumpAndAddToTrace(std::move(pmd_async_state));
- ContinueAsyncProcessDump(pmd_async_state.Pass());
+ ContinueAsyncProcessDump(std::move(pmd_async_state));
}
// static
@@ -444,7 +445,7 @@ void MemoryDumpManager::FinalizeDumpAndAddToTrace(
pmd_async_state->callback_task_runner;
callback_task_runner->PostTask(
FROM_HERE, Bind(&MemoryDumpManager::FinalizeDumpAndAddToTrace,
- Passed(pmd_async_state.Pass())));
+ Passed(&pmd_async_state)));
return;
}
@@ -529,7 +530,7 @@ void MemoryDumpManager::OnTraceLogEnabled() {
}
DCHECK(!dump_thread_);
- dump_thread_ = dump_thread.Pass();
+ dump_thread_ = std::move(dump_thread);
session_state_ = new MemoryDumpSessionState(stack_frame_deduplicator);
for (auto it = dump_providers_.begin(); it != dump_providers_.end(); ++it) {
@@ -583,7 +584,7 @@ void MemoryDumpManager::OnTraceLogDisabled() {
scoped_ptr<Thread> dump_thread;
{
AutoLock lock(lock_);
- dump_thread = dump_thread_.Pass();
+ dump_thread = std::move(dump_thread_);
session_state_ = nullptr;
}
@@ -645,7 +646,7 @@ ProcessMemoryDump* MemoryDumpManager::ProcessMemoryDumpAsyncState::
auto iter = process_dumps.find(pid);
if (iter == process_dumps.end()) {
scoped_ptr<ProcessMemoryDump> new_pmd(new ProcessMemoryDump(session_state));
- iter = process_dumps.insert(pid, new_pmd.Pass()).first;
+ iter = process_dumps.insert(pid, std::move(new_pmd)).first;
}
return iter->second;
}
« no previous file with comments | « base/timer/hi_res_timer_manager_unittest.cc ('k') | base/trace_event/trace_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698