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

Unified Diff: base/trace_event/memory_dump_manager.cc

Issue 987043003: [tracing] Introduce support for userland memory allocators dumps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mmaps_en
Patch Set: Rebase Created 5 years, 9 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
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 8b2d930a4bc5ab1e09b0f4295910eff07d474a53..47669d66c611e4c4cc889ee2569889cc95b1a658 100644
--- a/base/trace_event/memory_dump_manager.cc
+++ b/base/trace_event/memory_dump_manager.cc
@@ -59,7 +59,8 @@ void MemoryDumpManager::SetInstanceForTesting(MemoryDumpManager* instance) {
g_instance_for_testing = instance;
}
-MemoryDumpManager::MemoryDumpManager() : memory_tracing_enabled_(0) {
+MemoryDumpManager::MemoryDumpManager()
+ : dump_provider_currently_active_(nullptr), memory_tracing_enabled_(0) {
}
MemoryDumpManager::~MemoryDumpManager() {
@@ -129,6 +130,7 @@ void MemoryDumpManager::CreateLocalDumpPoint(DumpPointType dump_point_type,
for (auto it = dump_providers_enabled_.begin();
it != dump_providers_enabled_.end();) {
MemoryDumpProvider* dump_provider = *it;
+ dump_provider_currently_active_ = dump_provider;
picksi 2015/03/16 09:18:06 Am I correct in thinking that dump_provider_curren
Primiano Tucci (use gerrit) 2015/03/16 09:57:17 Yes, but I couldn't come up with a better alternat
picksi 2015/03/16 10:25:04 "It feels a little dangerous" to me because AsValu
Primiano Tucci (use gerrit) 2015/03/17 10:30:59 I see the point. But on the other side of the trad
if (dump_provider->DumpInto(pmd.get())) {
did_any_provider_dump = true;
++it;
@@ -139,6 +141,7 @@ void MemoryDumpManager::CreateLocalDumpPoint(DumpPointType dump_point_type,
"with the --no-sandbox switch.";
it = dump_providers_enabled_.erase(it);
}
+ dump_provider_currently_active_ = nullptr;
}
}

Powered by Google App Engine
This is Rietveld 408576698