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

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

Issue 2778123003: [scheduler] Add WakeupBudgetPool. (Closed)
Patch Set: Addressed comments from alexclarke@ 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
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 9126c6f02e88f3329f04f6f29b801b5121cd0e5c..5f20bee0dca7e6e5c33136c052ea4172fee5707c 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
@@ -26,8 +26,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;
Sami 2017/04/29 17:43:02 nit: next_task_run_time_
altimin 2017/05/02 18:16:58 Done.
+}
+
base::Optional<base::TimeDelta> ThrottledTimeDomain::DelayTillNextTask(
LazyNow* lazy_now) {
+ if (next_task_ && next_task_ > lazy_now->Now())
+ return next_task_.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