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

Unified Diff: base/trace_event/memory_peak_detector.cc

Issue 2799023002: memory-infra: Switch to MemoryPeakDetector and simplify MemoryDumpScheduler (Closed)
Patch Set: ssid comments + add more tests Created 3 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/memory_peak_detector.cc
diff --git a/base/trace_event/memory_peak_detector.cc b/base/trace_event/memory_peak_detector.cc
index f0c1ddff24a91e5c44639fbe25ac7a1357c5c4fe..c2ea9957e6c202a5a46c9c442a5c3e5efdb80511 100644
--- a/base/trace_event/memory_peak_detector.cc
+++ b/base/trace_event/memory_peak_detector.cc
@@ -118,6 +118,8 @@ void MemoryPeakDetector::StopInternal() {
DCHECK_NE(NOT_INITIALIZED, state_);
state_ = DISABLED;
++generation_;
+ for (const scoped_refptr<MemoryDumpProviderInfo>& mdp_info : dump_providers_)
+ mdp_info->dump_provider->SuspendFastMemoryPolling();
dump_providers_.clear();
}
@@ -256,5 +258,16 @@ void MemoryPeakDetector::SetStaticThresholdForTesting(
static_threshold_bytes_ = static_threshold_bytes;
}
+MemoryPeakDetector::MemoryPeakDetector::Config::Config()
+ : Config(0, 0, false) {}
+
+MemoryPeakDetector::MemoryPeakDetector::Config::Config(
+ uint32_t polling_interval_ms,
+ uint32_t min_time_between_peaks_ms,
+ bool enable_verbose_poll_tracing)
+ : polling_interval_ms(polling_interval_ms),
+ min_time_between_peaks_ms(min_time_between_peaks_ms),
+ enable_verbose_poll_tracing(enable_verbose_poll_tracing) {}
+
} // namespace trace_event
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698