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

Unified Diff: base/trace_event/memory_dump_session_state.cc

Issue 2537363003: [memory-infra] Add support for polling memory totals in MemoryDumpManager (Closed)
Patch Set: nits. Created 4 years 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 | « base/trace_event/memory_dump_session_state.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/memory_dump_session_state.cc
diff --git a/base/trace_event/memory_dump_session_state.cc b/base/trace_event/memory_dump_session_state.cc
index b3d9a8ccfc8ff765e6b9c0e69ee18f1a6bd387f1..3e3bedbb2989b382dab7c85cc002dbc4f4287b64 100644
--- a/base/trace_event/memory_dump_session_state.cc
+++ b/base/trace_event/memory_dump_session_state.cc
@@ -7,7 +7,7 @@
namespace base {
namespace trace_event {
-MemoryDumpSessionState::MemoryDumpSessionState() {}
+MemoryDumpSessionState::MemoryDumpSessionState() : is_polling_enabled_(false) {}
MemoryDumpSessionState::~MemoryDumpSessionState() {}
@@ -26,6 +26,10 @@ void MemoryDumpSessionState::SetTypeNameDeduplicator(
void MemoryDumpSessionState::SetMemoryDumpConfig(
const TraceConfig::MemoryDumpConfig& config) {
memory_dump_config_ = config;
+ for (const auto& trigger : config.triggers) {
+ if (trigger.trigger_type == MemoryDumpType::PEAK_MEMORY_USAGE)
+ is_polling_enabled_ = true;
+ }
}
} // namespace trace_event
« no previous file with comments | « base/trace_event/memory_dump_session_state.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698