Index: base/trace_event/process_memory_dump.cc |
diff --git a/base/trace_event/process_memory_dump.cc b/base/trace_event/process_memory_dump.cc |
index 0a3e0965f0bc0e24ec8934b4676608c2d8d20090..d3bb0a9d33d327c2f5fa2d84759962dd0b5d54c3 100644 |
--- a/base/trace_event/process_memory_dump.cc |
+++ b/base/trace_event/process_memory_dump.cc |
@@ -5,6 +5,7 @@ |
#include "base/trace_event/process_memory_dump.h" |
#include "base/json/json_writer.h" |
+#include "base/trace_event/process_memory_totals.h" |
#include "base/values.h" |
namespace base { |
@@ -16,11 +17,18 @@ ProcessMemoryDump::ProcessMemoryDump() { |
ProcessMemoryDump::~ProcessMemoryDump() { |
} |
+void ProcessMemoryDump::SetProcessTotals(scoped_ptr<ProcessMemoryTotals> pmt) { |
+ process_totals_ = pmt.Pass(); |
+} |
+ |
void ProcessMemoryDump::AppendAsTraceFormat(std::string* out) const { |
// Build up the [dumper name] -> [serialized snapshot] JSON dictionary. |
DictionaryValue dict; |
std::string json_dict; |
- // TODO(primiano): this will append here the actual dumps from the dumpers. |
+ |
+ if (process_totals_) |
+ dict.Set("process_totals", process_totals_->AsValue()); |
+ |
base::JSONWriter::Write(&dict, &json_dict); |
*out += json_dict; |
} |