Index: base/trace_event/memory_allocator_dump.cc |
diff --git a/base/trace_event/memory_allocator_dump.cc b/base/trace_event/memory_allocator_dump.cc |
index 5c5af7ee45842e716b92c5fcf7018641a3bfb023..9688cf665718c41c3b6a452433656180f699beb0 100644 |
--- a/base/trace_event/memory_allocator_dump.cc |
+++ b/base/trace_event/memory_allocator_dump.cc |
@@ -24,11 +24,13 @@ const char MemoryAllocatorDump::kUnitsObjects[] = "objects"; |
MemoryAllocatorDump::MemoryAllocatorDump(const std::string& absolute_name, |
ProcessMemoryDump* process_memory_dump, |
- const MemoryAllocatorDumpGuid& guid) |
+ const MemoryAllocatorDumpGuid& guid, |
+ uint8_t flags) |
: absolute_name_(absolute_name), |
process_memory_dump_(process_memory_dump), |
attributes_(new TracedValue), |
- guid_(guid) { |
+ guid_(guid), |
+ flags_(flags) { |
// The |absolute_name| cannot be empty. |
DCHECK(!absolute_name.empty()); |
@@ -37,6 +39,14 @@ MemoryAllocatorDump::MemoryAllocatorDump(const std::string& absolute_name, |
DCHECK(absolute_name[0] != '/' && *absolute_name.rbegin() != '/'); |
} |
+MemoryAllocatorDump::MemoryAllocatorDump(const std::string& absolute_name, |
+ ProcessMemoryDump* process_memory_dump, |
+ const MemoryAllocatorDumpGuid& guid) |
+ : MemoryAllocatorDump(absolute_name, |
+ process_memory_dump, |
+ guid, |
+ 0 /* flags */) {} |
+ |
// If the caller didn't provide a guid, make one up by hashing the |
// absolute_name with the current PID. |
// Rationale: |absolute_name| is already supposed to be unique within a |
@@ -48,7 +58,8 @@ MemoryAllocatorDump::MemoryAllocatorDump(const std::string& absolute_name, |
MemoryAllocatorDumpGuid(StringPrintf( |
"%d:%s", |
TraceLog::GetInstance()->process_id(), |
- absolute_name.c_str()))) { |
+ absolute_name.c_str())), |
+ 0 /* flags */) { |
string_conversion_buffer_.reserve(16); |
} |
@@ -90,6 +101,8 @@ void MemoryAllocatorDump::AsValueInto(TracedValue* value) const { |
value->BeginDictionaryWithCopiedName(absolute_name_); |
value->SetString("guid", guid_.ToString()); |
value->SetValue("attrs", *attributes_); |
+ if (flags_) |
+ value->SetInteger("flags", static_cast<int>(flags_)); |
value->EndDictionary(); // "allocator_name/heap_subheap": { ... } |
} |