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

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

Issue 2778123003: [scheduler] Add WakeupBudgetPool. (Closed)
Patch Set: Addressed comments 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/throttled_time_domain.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/throttled_time_domain.cc b/third_party/WebKit/Source/platform/scheduler/renderer/throttled_time_domain.cc
index f7a7205e87f285684b74ff7a33938c363c057463..7c0aa574e41a9b3d1d3d297387add1f8626928a6 100644
--- a/third_party/WebKit/Source/platform/scheduler/renderer/throttled_time_domain.cc
+++ b/third_party/WebKit/Source/platform/scheduler/renderer/throttled_time_domain.cc
@@ -25,8 +25,15 @@ void ThrottledTimeDomain::CancelWakeUpAt(base::TimeTicks run_time) {
// We ignore this because RequestWakeUpAt is a NOP.
}
+void ThrottledTimeDomain::SetNextTaskRunTime(base::TimeTicks run_time) {
+ next_task_run_time_ = run_time;
+}
+
base::Optional<base::TimeDelta> ThrottledTimeDomain::DelayTillNextTask(
LazyNow* lazy_now) {
+ if (next_task_run_time_ && next_task_run_time_ > lazy_now->Now())
+ return next_task_run_time_.value() - lazy_now->Now();
+
base::TimeTicks next_run_time;
if (!NextScheduledRunTime(&next_run_time))
return base::nullopt;

Powered by Google App Engine
This is Rietveld 408576698