| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/trace_event/process_memory_dump.h" | 5 #include "base/trace_event/process_memory_dump.h" |
| 6 | 6 |
| 7 #include "base/trace_event/process_memory_totals.h" | 7 #include "base/trace_event/process_memory_totals.h" |
| 8 #include "base/trace_event/trace_event_argument.h" | 8 #include "base/trace_event/trace_event_argument.h" |
| 9 | 9 |
| 10 namespace base { | 10 namespace base { |
| 11 namespace trace_event { | 11 namespace trace_event { |
| 12 | 12 |
| 13 ProcessMemoryDump::ProcessMemoryDump() : has_process_totals_(false) { | 13 ProcessMemoryDump::ProcessMemoryDump() |
| 14 : has_process_totals_(false), has_process_mmaps_(false) { |
| 14 } | 15 } |
| 15 | 16 |
| 16 ProcessMemoryDump::~ProcessMemoryDump() { | 17 ProcessMemoryDump::~ProcessMemoryDump() { |
| 17 } | 18 } |
| 18 | 19 |
| 19 void ProcessMemoryDump::AsValueInto(TracedValue* value) const { | 20 void ProcessMemoryDump::AsValueInto(TracedValue* value) const { |
| 20 // Build up the [dumper name] -> [value] dictionary. | 21 // Build up the [dumper name] -> [value] dictionary. |
| 21 if (has_process_totals_) { | 22 if (has_process_totals_) { |
| 22 value->BeginDictionary("process_totals"); | 23 value->BeginDictionary("process_totals"); |
| 23 process_totals_.AsValueInto(value); | 24 process_totals_.AsValueInto(value); |
| 24 value->EndDictionary(); | 25 value->EndDictionary(); |
| 25 } | 26 } |
| 27 if (has_process_mmaps_) { |
| 28 value->BeginDictionary("process_mmaps"); |
| 29 process_mmaps_.AsValueInto(value); |
| 30 value->EndDictionary(); |
| 31 } |
| 26 } | 32 } |
| 27 | 33 |
| 28 } // namespace trace_event | 34 } // namespace trace_event |
| 29 } // namespace base | 35 } // namespace base |
| OLD | NEW |