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

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

Issue 2896603002: [scheduler] Move task alignment into WakeUpBudgetPool. (Closed)
Patch Set: no iostream Created 3 years, 7 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/task_queue_throttler.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc b/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc
index dd0baccae90a392aa8645b2f108509f75e8368fb..bb680986e5ce0d613753be1e5b0de6401dea6c74 100644
--- a/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc
+++ b/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc
@@ -202,6 +202,7 @@ void TaskQueueThrottler::OnQueueNextWakeUpChanged(
return;
base::TimeTicks now = tick_clock_->NowTicks();
+ next_wake_up = std::max(now, next_wake_up);
auto find_it = queue_details_.find(queue);
if (find_it == queue_details_.end())
@@ -250,8 +251,11 @@ void TaskQueueThrottler::MaybeSchedulePumpThrottledTasks(
if (!allow_throttling_)
return;
+ // TODO(altimin): Consider removing alignment here.
Z_DONOTUSE 2017/05/23 19:31:46 Ditto.
base::TimeTicks runtime =
- AlignedThrottledRunTime(std::max(now, unaligned_runtime));
+ std::max(now, unaligned_runtime)
+ .SnappedToNextTick(base::TimeTicks(),
+ base::TimeDelta::FromSeconds(1));
DCHECK_LE(now, runtime);
// If there is a pending call to PumpThrottledTasks and it's sooner than

Powered by Google App Engine
This is Rietveld 408576698