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/memory_allocator_dump.h" | 5 #include "base/trace_event/memory_allocator_dump.h" |
6 | 6 |
7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/trace_event/memory_dump_manager.h" | 9 #include "base/trace_event/memory_dump_manager.h" |
10 #include "base/trace_event/memory_dump_provider.h" | 10 #include "base/trace_event/memory_dump_provider.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 const std::string& value) { | 102 const std::string& value) { |
103 scoped_ptr<Value> str_value(new StringValue(value)); | 103 scoped_ptr<Value> str_value(new StringValue(value)); |
104 Add(name, kTypeString, units, str_value.Pass()); | 104 Add(name, kTypeString, units, str_value.Pass()); |
105 } | 105 } |
106 | 106 |
107 void MemoryAllocatorDump::AsValueInto(TracedValue* value) const { | 107 void MemoryAllocatorDump::AsValueInto(TracedValue* value) const { |
108 value->BeginDictionary(absolute_name_.c_str()); | 108 value->BeginDictionary(absolute_name_.c_str()); |
109 value->BeginDictionary("attrs"); | 109 value->BeginDictionary("attrs"); |
110 | 110 |
111 for (DictionaryValue::Iterator it(attributes_); !it.IsAtEnd(); it.Advance()) | 111 for (DictionaryValue::Iterator it(attributes_); !it.IsAtEnd(); it.Advance()) |
112 value->SetValue(it.key().c_str(), it.value().DeepCopy()); | 112 value->SetValue(it.key().c_str(), it.value().CreateDeepCopy()); |
113 | 113 |
114 value->EndDictionary(); // "attrs": { ... } | 114 value->EndDictionary(); // "attrs": { ... } |
115 value->EndDictionary(); // "allocator_name/heap_subheap": { ... } | 115 value->EndDictionary(); // "allocator_name/heap_subheap": { ... } |
116 } | 116 } |
117 | 117 |
118 } // namespace trace_event | 118 } // namespace trace_event |
119 } // namespace base | 119 } // namespace base |
OLD | NEW |