Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Unified Diff: base/trace_event/memory_allocator_dump.h

Issue 1583483002: [tracing] Add method to create "weak" global dumps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/trace_event/memory_allocator_dump.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..33a15432b98bc2d7b8c0fc7889570c715433d7f0 100644
--- a/base/trace_event/memory_allocator_dump.h
+++ b/base/trace_event/memory_allocator_dump.h
@@ -26,6 +26,13 @@ class TracedValue;
// Data model for user-land memory allocator dumps.
class BASE_EXPORT MemoryAllocatorDump {
public:
+ enum Flags {
+ DEFAULT = 0,
+
+ // A dump marked weak will be discarded by TraceViewer.
+ WEAK = 1 << 0,
+ };
+
// MemoryAllocatorDump is owned by ProcessMemoryDump.
MemoryAllocatorDump(const std::string& absolute_name,
ProcessMemoryDump* process_memory_dump,
@@ -68,6 +75,11 @@ class BASE_EXPORT MemoryAllocatorDump {
return process_memory_dump_;
}
+ // Use enum Flags to set values.
+ void set_flags(int flags) { flags_ |= flags; }
+ void clear_flags(int flags) { flags_ &= ~flags; }
+ int 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 +95,7 @@ class BASE_EXPORT MemoryAllocatorDump {
ProcessMemoryDump* const process_memory_dump_; // Not owned (PMD owns this).
scoped_refptr<TracedValue> attributes_;
MemoryAllocatorDumpGuid guid_;
+ int flags_; // See enum Flags.
// A local buffer for Sprintf conversion on fastpath. Avoids allocating
// temporary strings on each AddScalar() call.
« no previous file with comments | « no previous file | base/trace_event/memory_allocator_dump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698