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

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

Issue 1718233002: Fix computation of runtime for throttled tasks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo 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 5ce23f16f3ce201e1181628959bd6f5fa423a794..c11aeca78ab19eb7441d1156a32ec505fe6b8911 100644
--- a/components/scheduler/base/task_queue_impl.cc
+++ b/components/scheduler/base/task_queue_impl.cc
@@ -186,11 +186,14 @@ bool TaskQueueImpl::PostDelayedTaskImpl(
EnqueueOrder sequence_number =
main_thread_only().task_queue_manager->GetNextSequenceNumber();
- base::TimeTicks now = main_thread_only().time_domain->Now();
+ base::TimeTicks time_domain_now = main_thread_only().time_domain->Now();
+ base::TimeTicks time_domain_delayed_run_time =
+ main_thread_only().time_domain->ComputeDelayedRunTime(time_domain_now,
+ delay);
PushOntoDelayedIncomingQueueFromMainThread(
- Task(from_here, task, now + delay, sequence_number,
+ Task(from_here, task, time_domain_delayed_run_time, sequence_number,
task_type != TaskType::NON_NESTABLE),
- now);
+ time_domain_now);
} else {
// NOTE posting a delayed task from a different thread is not expected to
// be common. This pathway is less optimal than perhaps it could be
@@ -203,9 +206,12 @@ bool TaskQueueImpl::PostDelayedTaskImpl(
EnqueueOrder sequence_number =
any_thread().task_queue_manager->GetNextSequenceNumber();
+ base::TimeTicks time_domain_now = any_thread().time_domain->Now();
+ base::TimeTicks time_domain_delayed_run_time =
+ any_thread().time_domain->ComputeDelayedRunTime(time_domain_now, delay);
PushOntoDelayedIncomingQueueLocked(
- Task(from_here, task, any_thread().time_domain->Now() + delay,
- sequence_number, task_type != TaskType::NON_NESTABLE));
+ Task(from_here, task, time_domain_delayed_run_time, sequence_number,
+ task_type != TaskType::NON_NESTABLE));
}
return true;
}
« 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