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

Unified Diff: third_party/WebKit/Source/platform/scheduler/child/idle_helper.cc

Issue 2637463002: Add an idle task to periodically sweep canceled delayed tasks (Closed)
Patch Set: Fix issue with tracked_objects::Location spotted by asan Created 3 years, 11 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: third_party/WebKit/Source/platform/scheduler/child/idle_helper.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/child/idle_helper.cc b/third_party/WebKit/Source/platform/scheduler/child/idle_helper.cc
index e0935523d170340b5279f2e31a4e2b4443398b96..07a8e08a6356fde50b184800dfe5079245c6b572 100644
--- a/third_party/WebKit/Source/platform/scheduler/child/idle_helper.cc
+++ b/third_party/WebKit/Source/platform/scheduler/child/idle_helper.cc
@@ -174,6 +174,9 @@ void IdleHelper::StartIdlePeriod(IdlePeriodState new_state,
helper_->CheckOnValidThread();
DCHECK(IsInIdlePeriod(new_state));
+ // Allow any ready delayed idle tasks to run.
+ idle_task_runner_->EnqueueReadyDelayedIdleTasks();
+
base::TimeDelta idle_period_duration(idle_period_deadline - now);
if (idle_period_duration <
base::TimeDelta::FromMilliseconds(kMinimumIdlePeriodDurationMillis)) {
@@ -321,6 +324,10 @@ void IdleHelper::DidProcessIdleTask() {
}
}
+base::TimeTicks IdleHelper::NowTicks() {
+ return helper_->scheduler_tqm_delegate()->NowTicks();
+}
+
// static
bool IdleHelper::IsInIdlePeriod(IdlePeriodState state) {
return state != IdlePeriodState::NOT_IN_IDLE_PERIOD;

Powered by Google App Engine
This is Rietveld 408576698