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

Unified Diff: base/trace_event/memory_dump_scheduler.h

Issue 2736283003: [memory-infra] MemoryDumpScheduler follows config for time between dumps (Closed)
Patch Set: rebase. Created 3 years, 9 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_dump_scheduler.h
diff --git a/base/trace_event/memory_dump_scheduler.h b/base/trace_event/memory_dump_scheduler.h
index b063734fce8afdee20aa4aad1668b3c2354e27f7..dc0c6ba97b795f3099615209c4e28e917b474d51 100644
--- a/base/trace_event/memory_dump_scheduler.h
+++ b/base/trace_event/memory_dump_scheduler.h
@@ -41,6 +41,10 @@ class BASE_EXPORT MemoryDumpScheduler {
// Starts polling memory total.
void NotifyPollingSupported();
+ // Resets time for triggering dump to account for minimum time between the
+ // dumps.
+ void NotifyDumpTriggered();
+
// Disables all triggers.
void DisableAllTriggers();
@@ -68,14 +72,22 @@ class BASE_EXPORT MemoryDumpScheduler {
};
struct PollingTriggerState {
+ enum State {
+ CONFIGURED, // Polling trigger was added.
+ ENABLED, // Polling is running.
+ DISABLED // Polling is disabled.
+ };
+
static const uint32_t kNumTotalsTrackedForPeakDetection = 50;
explicit PollingTriggerState(
scoped_refptr<SingleThreadTaskRunner> polling_task_runner);
~PollingTriggerState();
- bool is_configured;
- bool is_polling_enabled;
+ // Helper to clear the tracked memory totals and poll count from last dump.
+ void ResetTotals();
+
+ State current_state;
MemoryDumpLevelOfDetail level_of_detail;
scoped_refptr<SingleThreadTaskRunner> polling_task_runner;

Powered by Google App Engine
This is Rietveld 408576698