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

Unified Diff: base/trace_event/memory_dump_scheduler.cc

Issue 2815963002: [memory-infra] Trigger first periodic dump after initial period (Closed)
Patch Set: Just fix peridic dumps. 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
« no previous file with comments | « no previous file | 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_scheduler.cc
diff --git a/base/trace_event/memory_dump_scheduler.cc b/base/trace_event/memory_dump_scheduler.cc
index 17921959d38fe7275a37c73341569a8ba1622548..b1d34d93403a5b6f9fd62b50ef3a3ff28454ef97 100644
--- a/base/trace_event/memory_dump_scheduler.cc
+++ b/base/trace_event/memory_dump_scheduler.cc
@@ -72,9 +72,12 @@ void MemoryDumpScheduler::StartInternal(MemoryDumpScheduler::Config config) {
tick_count_ = 0;
light_dump_rate_ = light_dump_period_ms / min_period_ms;
heavy_dump_rate_ = heavy_dump_period_ms / min_period_ms;
- SequencedTaskRunnerHandle::Get()->PostTask(
+
+ // Trigger the first dump after |period_ms_| and not as soon as timer starts.
+ SequencedTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE,
- BindOnce(&MemoryDumpScheduler::Tick, Unretained(this), ++generation_));
+ BindOnce(&MemoryDumpScheduler::Tick, Unretained(this), ++generation_),
+ TimeDelta::FromMilliseconds(period_ms_));
}
void MemoryDumpScheduler::StopInternal() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698