| 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" |
| 11 #include "base/trace_event/process_memory_dump.h" | 11 #include "base/trace_event/process_memory_dump.h" |
| 12 #include "base/trace_event/trace_event_argument.h" | 12 #include "base/trace_event/trace_event_argument.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 namespace trace_event { | 16 namespace trace_event { |
| 17 | 17 |
| 18 const char MemoryAllocatorDump::kNameSize[] = "size"; | 18 const char MemoryAllocatorDump::kNameSize[] = "size"; |
| 19 const char MemoryAllocatorDump::kNameObjectsCount[] = "objects_count"; | 19 const char MemoryAllocatorDump::kNameObjectCount[] = "object_count"; |
| 20 const char MemoryAllocatorDump::kTypeScalar[] = "scalar"; | 20 const char MemoryAllocatorDump::kTypeScalar[] = "scalar"; |
| 21 const char MemoryAllocatorDump::kTypeString[] = "string"; | 21 const char MemoryAllocatorDump::kTypeString[] = "string"; |
| 22 const char MemoryAllocatorDump::kUnitsBytes[] = "bytes"; | 22 const char MemoryAllocatorDump::kUnitsBytes[] = "bytes"; |
| 23 const char MemoryAllocatorDump::kUnitsObjects[] = "objects"; | 23 const char MemoryAllocatorDump::kUnitsObjects[] = "objects"; |
| 24 | 24 |
| 25 MemoryAllocatorDump::MemoryAllocatorDump(const std::string& absolute_name, | 25 MemoryAllocatorDump::MemoryAllocatorDump(const std::string& absolute_name, |
| 26 ProcessMemoryDump* process_memory_dump, | 26 ProcessMemoryDump* process_memory_dump, |
| 27 const MemoryAllocatorDumpGuid& guid) | 27 const MemoryAllocatorDumpGuid& guid) |
| 28 : absolute_name_(absolute_name), | 28 : absolute_name_(absolute_name), |
| 29 process_memory_dump_(process_memory_dump), | 29 process_memory_dump_(process_memory_dump), |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 void MemoryAllocatorDump::AsValueInto(TracedValue* value) const { | 93 void MemoryAllocatorDump::AsValueInto(TracedValue* value) const { |
| 94 value->BeginDictionaryWithCopiedName(absolute_name_); | 94 value->BeginDictionaryWithCopiedName(absolute_name_); |
| 95 value->SetString("guid", guid_.ToString()); | 95 value->SetString("guid", guid_.ToString()); |
| 96 value->SetValue("attrs", *attributes_); | 96 value->SetValue("attrs", *attributes_); |
| 97 value->EndDictionary(); // "allocator_name/heap_subheap": { ... } | 97 value->EndDictionary(); // "allocator_name/heap_subheap": { ... } |
| 98 } | 98 } |
| 99 | 99 |
| 100 } // namespace trace_event | 100 } // namespace trace_event |
| 101 } // namespace base | 101 } // namespace base |
| OLD | NEW |