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

Unified Diff: base/trace_event/trace_config.h

Issue 1911643002: Add configurable limit to allocations in heap profiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed naming in protocol.json Created 4 years, 8 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
Index: base/trace_event/trace_config.h
diff --git a/base/trace_event/trace_config.h b/base/trace_event/trace_config.h
index 72ca5f868785691b7686fef576f6eb59218c4592..fbebf0b6ad7c1987f899af5f5f309a9d080d172d 100644
--- a/base/trace_event/trace_config.h
+++ b/base/trace_event/trace_config.h
@@ -40,14 +40,42 @@ class BASE_EXPORT TraceConfig {
public:
typedef std::vector<std::string> StringList;
- // Specifies the memory dump config for tracing. Used only when
- // "memory-infra" category is enabled.
- struct MemoryDumpTriggerConfig {
- uint32_t periodic_interval_ms;
- MemoryDumpLevelOfDetail level_of_detail;
+ // Specifies the memory dump config for tracing.
+ // Used only when "memory-infra" category is enabled.
+ struct MemoryDumpConfig {
+ MemoryDumpConfig();
+ MemoryDumpConfig(const MemoryDumpConfig& other);
+ ~MemoryDumpConfig();
+
+ // Specifies the triggers in the memory dump config.
+ struct MemoryDumpTriggerConfig {
Primiano Tucci (use gerrit) 2016/04/28 07:33:45 I'd probably shorten these names (e.g. s/MemoryDum
Maria 2016/04/28 17:23:39 Done.
+ uint32_t periodic_interval_ms;
+ MemoryDumpLevelOfDetail level_of_detail;
+ };
+
+ // Specifies the configuration options for the heap profiler.
+ struct HeapProfilerOptions {
+ // Default value for |breakdown_threshold_bytes|.
+ enum { kDefaultBreakdownThresholdBytes = 1024 };
+
+ HeapProfilerOptions();
+ ~HeapProfilerOptions();
Primiano Tucci (use gerrit) 2016/04/28 07:33:45 I think you can omit empty dtors for trivial struc
Maria 2016/04/28 17:23:39 Done.
+
+ // Reset the options to default.
+ void Clear();
+
+ uint32_t breakdown_threshold_bytes;
+ };
+
+ // Reset the values in the config.
+ void Clear();
+
+ std::vector<MemoryDumpTriggerConfig> triggers;
+ HeapProfilerOptions heap_profiler_options;
};
- typedef std::vector<MemoryDumpTriggerConfig> MemoryDumpConfig;
+ typedef MemoryDumpConfig::MemoryDumpTriggerConfig MemoryDumpTrigger;
+ typedef MemoryDumpConfig::HeapProfilerOptions MemoryDumpHeapProfilerOptions;
TraceConfig();

Powered by Google App Engine
This is Rietveld 408576698