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..0b4821ac58a4c7cf75e8c2d914996902b751802e 100644 |
| --- a/base/trace_event/memory_allocator_dump.h |
| +++ b/base/trace_event/memory_allocator_dump.h |
| @@ -26,6 +26,12 @@ class TracedValue; |
| // Data model for user-land memory allocator dumps. |
| class BASE_EXPORT MemoryAllocatorDump { |
| public: |
| + enum Flag { |
|
Primiano Tucci (use gerrit)
2016/01/19 17:07:11
s/Flag/Flags/
ssid
2016/01/20 18:58:34
Done.
|
| + // A dump marked weak will be removed from tracing. It is used when dump |
|
Primiano Tucci (use gerrit)
2016/01/19 17:07:11
I'd clarify and say "will be discarded by TraceVie
ssid
2016/01/20 18:58:34
Done.
|
| + // provider is unsure of the existence of a block of memory. |
| + WEAK = 1 << 0, |
| + }; |
| + |
| // MemoryAllocatorDump is owned by ProcessMemoryDump. |
| MemoryAllocatorDump(const std::string& absolute_name, |
| ProcessMemoryDump* process_memory_dump, |
| @@ -68,6 +74,11 @@ class BASE_EXPORT MemoryAllocatorDump { |
| return process_memory_dump_; |
| } |
| + // Use enum Flag to set values. |
| + void set_flags(uint8_t flags) { flags_ |= flags; } |
|
Primiano Tucci (use gerrit)
2016/01/19 17:07:11
Why not just int (there seems to be lot of precede
ssid
2016/01/20 18:58:34
Done.
|
| + void unset_flags(uint8_t flags) { flags_ &= ~flags; } |
|
Primiano Tucci (use gerrit)
2016/01/19 17:07:11
s/unset/clear/
ssid
2016/01/20 18:58:34
Done.
|
| + 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 +94,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. |
|
Primiano Tucci (use gerrit)
2016/01/19 17:07:11
ditto here for int
ssid
2016/01/20 18:58:34
Done.
|
| // A local buffer for Sprintf conversion on fastpath. Avoids allocating |
| // temporary strings on each AddScalar() call. |