Chromium Code Reviews| Index: base/trace_event/memory_allocator_dump.h |
| diff --git a/base/trace_event/memory_allocator_dump.h b/base/trace_event/memory_allocator_dump.h |
| index 6c514fa6a62380b9ec6180792451a40b3a9dbbf9..62964aea933e651ee0f96f18473bdc7676857b67 100644 |
| --- a/base/trace_event/memory_allocator_dump.h |
| +++ b/base/trace_event/memory_allocator_dump.h |
| @@ -26,9 +26,19 @@ class TracedValue; |
| // Data model for user-land memory allocator dumps. |
| class BASE_EXPORT MemoryAllocatorDump { |
| public: |
| + enum Flag { |
| + // A dump marked weak will be removed from tracing. It is used when dump |
|
petrcermak
2016/01/18 11:23:46
nit: "... removed from tracing, unless it was/will
ssid
2016/01/18 16:28:35
Hm, I think as far as mad is concerned, it means t
petrcermak
2016/01/18 17:18:12
Good point. My concern is that this suggests that
|
| + // provider is unsure of the existance of memory. |
|
petrcermak
2016/01/18 11:23:46
s/existance/existence/
petrcermak
2016/01/18 11:23:46
nit: s/memory/a block of memory/ (memory always ex
ssid
2016/01/18 16:28:35
Done.
ssid
2016/01/18 16:28:35
Done.
|
| + WEAK = 1 << 0, |
| + }; |
| + |
| // MemoryAllocatorDump is owned by ProcessMemoryDump. |
| MemoryAllocatorDump(const std::string& absolute_name, |
| ProcessMemoryDump* process_memory_dump, |
| + const MemoryAllocatorDumpGuid& guid, |
| + uint8_t flags); |
|
petrcermak
2016/01/18 11:23:46
As explained in my comment in ProcessMemoryDump, a
ssid
2016/01/18 16:28:35
true.
|
| + MemoryAllocatorDump(const std::string& absolute_name, |
| + ProcessMemoryDump* process_memory_dump, |
| const MemoryAllocatorDumpGuid& guid); |
| MemoryAllocatorDump(const std::string& absolute_name, |
| ProcessMemoryDump* process_memory_dump); |
| @@ -68,6 +78,11 @@ class BASE_EXPORT MemoryAllocatorDump { |
| return process_memory_dump_; |
| } |
| + // Use enum Flag to set values. |
| + void set_flags(uint8_t flags) { flags_ |= flags; } |
| + void unset_flags(uint8_t flags) { flags_ &= ~flags; } |
| + uint8_t flags() { return flags_; } |
| + |
| // |guid| is an optional global dump identifier, unique across all processes |
| // within the scope of a global dump. It is only required when using the |
| // graph APIs (see TODO_method_name) to express retention / suballocation or |
| @@ -83,6 +98,7 @@ class BASE_EXPORT MemoryAllocatorDump { |
| ProcessMemoryDump* const process_memory_dump_; // Not owned (PMD owns this). |
| scoped_refptr<TracedValue> attributes_; |
| MemoryAllocatorDumpGuid guid_; |
| + uint8_t flags_; // See enum Flag. |
| // A local buffer for Sprintf conversion on fastpath. Avoids allocating |
| // temporary strings on each AddScalar() call. |