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

Unified Diff: base/trace_event/memory_dump_manager.cc

Issue 934323002: [tracing] Add a dump provider to dump process memory totals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch to AsValueInto pattern and remove unnecessary allocations Created 5 years, 10 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 bf631b34bea033cba4c95f76d4f73439ed703d3f..27c67652550b48a31dd6a49f2afb0d069761cec6 100644
--- a/base/trace_event/memory_dump_manager.cc
+++ b/base/trace_event/memory_dump_manager.cc
@@ -9,6 +9,7 @@
#include "base/compiler_specific.h"
#include "base/trace_event/memory_dump_provider.h"
#include "base/trace_event/process_memory_dump.h"
+#include "base/trace_event/trace_event_argument.h"
// TODO(primiano): in a separate CL rename DeleteTraceLogForTesting into
// something like base::internal::TeardownSingletonForTesting so we don't have
@@ -99,12 +100,14 @@ void MemoryDumpManager::CreateLocalDumpPoint() {
// TRACE_EVENT_* macros don't induce scoped_refptr type inference, hence we
// need the base ConvertableToTraceFormat and the upcast below. The
// alternative would be unnecessarily expensive (double Acquire/Release).
- scoped_refptr<ConvertableToTraceFormat> pmd(new ProcessMemoryDump());
+ scoped_ptr<ProcessMemoryDump> pmd(new ProcessMemoryDump());
Sami 2015/02/19 12:07:05 Is this cast trickery now obsolete?
Primiano Tucci (use gerrit) 2015/02/19 12:18:12 Oh right (FTR: skyostil@ was referring to line 106
Sami 2015/02/19 16:16:36 Right, and also to the comment above this line :)
for (MemoryDumpProvider* dump_provider : dump_providers_enabled_) {
dump_provider->DumpInto(static_cast<ProcessMemoryDump*>(pmd.get()));
}
+ scoped_refptr<TracedValue> value(new TracedValue());
+ pmd->AsValueInto(value.get());
// TODO(primiano): add the dump point to the trace at this point.
}

Powered by Google App Engine
This is Rietveld 408576698