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

Unified Diff: components/scheduler/base/task_queue_impl.cc

Issue 1751953002: [Cherrypick try #2] Fix computation of runtime for throttled tasks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2623
Patch Set: Fix formatting Created 4 years, 10 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
« no previous file with comments | « components/scheduler/base/real_time_domain.cc ('k') | components/scheduler/base/time_domain.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/scheduler/base/task_queue_impl.cc
diff --git a/components/scheduler/base/task_queue_impl.cc b/components/scheduler/base/task_queue_impl.cc
index b449e2dd9183be5d99f9e2e8c06d5a405e61822f..0d79b0db3f784f9de6284f57ac363da472198a42 100644
--- a/components/scheduler/base/task_queue_impl.cc
+++ b/components/scheduler/base/task_queue_impl.cc
@@ -149,8 +149,11 @@ bool TaskQueueImpl::PostDelayedTaskImpl(
return false;
LazyNow lazy_now(any_thread().time_domain->CreateLazyNow());
base::TimeTicks desired_run_time;
- if (delay > base::TimeDelta())
- desired_run_time = lazy_now.Now() + delay;
+ if (delay > base::TimeDelta()) {
+ base::TimeTicks time_domain_now = lazy_now.Now();
+ desired_run_time =
+ any_thread().time_domain->ComputeDelayedRunTime(time_domain_now, delay);
+ }
return PostDelayedTaskLocked(&lazy_now, from_here, task, desired_run_time,
task_type);
}
« no previous file with comments | « components/scheduler/base/real_time_domain.cc ('k') | components/scheduler/base/time_domain.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698