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

Unified Diff: base/trace_event/memory_dump_scheduler.h

Issue 2736283003: [memory-infra] MemoryDumpScheduler follows config for time between dumps (Closed)
Patch Set: fix task runner check and 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
« no previous file with comments | « base/trace_event/memory_dump_manager.cc ('k') | base/trace_event/memory_dump_scheduler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 be7530691a83748538a55ead0cdc3d458959fc84..fd21fce834949be99aa386a1e12362a103368d48 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 kMaxNumMemorySamples = 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;
« no previous file with comments | « base/trace_event/memory_dump_manager.cc ('k') | base/trace_event/memory_dump_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698