Chromium Code Reviews| 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; |