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

Unified Diff: base/trace_event/memory_dump_manager.cc

Issue 2895083004: memory-infra: rename service folder to memory_instrumentation (Closed)
Patch Set: comments Created 3 years, 7 months 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/trace_event/memory_dump_manager.h ('k') | base/trace_event/memory_dump_manager_unittest.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 bd00bd66993e2b5821ef53b8cd0eefd610476d8b..008b22a2d30be84f4e79db9b2c20de715c7c95ce 100644
--- a/base/trace_event/memory_dump_manager.cc
+++ b/base/trace_event/memory_dump_manager.cc
@@ -157,8 +157,11 @@ MemoryDumpManager* MemoryDumpManager::GetInstance() {
}
// static
-void MemoryDumpManager::SetInstanceForTesting(MemoryDumpManager* instance) {
- g_instance_for_testing = instance;
+std::unique_ptr<MemoryDumpManager>
+MemoryDumpManager::CreateInstanceForTesting() {
+ std::unique_ptr<MemoryDumpManager> instance(new MemoryDumpManager());
+ g_instance_for_testing = instance.get();
+ return instance;
}
MemoryDumpManager::MemoryDumpManager()
@@ -186,6 +189,7 @@ MemoryDumpManager::~MemoryDumpManager() {
}
AutoLock lock(lock_);
dump_thread_.reset();
+ g_instance_for_testing = nullptr;
}
void MemoryDumpManager::EnableHeapProfilingIfNeeded() {
« no previous file with comments | « base/trace_event/memory_dump_manager.h ('k') | base/trace_event/memory_dump_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698