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

Unified Diff: third_party/WebKit/Source/platform/scheduler/renderer/throttling_helper.cc

Issue 2359493002: Prevent redundant DoWorks due to canceled delayed tasks (v2) (Closed)
Patch Set: Added a test and removed some code we probably don't need. Created 4 years, 3 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/renderer/throttling_helper.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/throttling_helper.cc b/third_party/WebKit/Source/platform/scheduler/renderer/throttling_helper.cc
index 20ff3a1116f6628a01002daf48055ed181c184e0..30af398b8cdaabd2a89a8598d64ee17b76b23ebe 100644
--- a/third_party/WebKit/Source/platform/scheduler/renderer/throttling_helper.cc
+++ b/third_party/WebKit/Source/platform/scheduler/renderer/throttling_helper.cc
@@ -146,7 +146,6 @@ void ThrottlingHelper::PumpThrottledTasks() {
TRACE_EVENT0(tracing_category_, "ThrottlingHelper::PumpThrottledTasks");
pending_pump_throttled_tasks_runtime_ = base::TimeTicks();
- LazyNow lazy_low(tick_clock_);
for (const TaskQueueMap::value_type& map_entry : throttled_queues_) {
TaskQueue* task_queue = map_entry.first;
if (!map_entry.second.enabled || task_queue->IsEmpty())
@@ -155,15 +154,14 @@ void ThrottlingHelper::PumpThrottledTasks() {
task_queue->SetQueueEnabled(true);
task_queue->InsertFence();
}
- // Make sure NextScheduledRunTime gives us an up-to date result.
- time_domain_->ClearExpiredWakeups();
base::TimeTicks next_scheduled_delayed_task;
// Maybe schedule a call to ThrottlingHelper::PumpThrottledTasks if there is
// a pending delayed task. NOTE posting a non-delayed task in the future will
// result in ThrottlingHelper::OnTimeDomainHasImmediateWork being called.
if (time_domain_->NextScheduledRunTime(&next_scheduled_delayed_task)) {
- MaybeSchedulePumpThrottledTasksLocked(FROM_HERE, lazy_low.Now(),
+ LazyNow lazy_now(tick_clock_);
+ MaybeSchedulePumpThrottledTasksLocked(FROM_HERE, lazy_now.Now(),
next_scheduled_delayed_task);
}
}

Powered by Google App Engine
This is Rietveld 408576698