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

Unified Diff: base/task_scheduler/scheduler_worker_pool_impl.cc

Issue 2399213005: TaskScheduler: Change Sequence::PeekTask to Sequence::TakeTask. (Closed)
Patch Set: CR robliao #5 Created 4 years, 2 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 | « base/task_scheduler/scheduler_worker.cc ('k') | base/task_scheduler/scheduler_worker_stack_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/scheduler_worker_pool_impl.cc
diff --git a/base/task_scheduler/scheduler_worker_pool_impl.cc b/base/task_scheduler/scheduler_worker_pool_impl.cc
index ed8e84a336d6ac3015099e935e6ba2f0b6769598..dc040301ca31af4868522b3983b112f293e0d28e 100644
--- a/base/task_scheduler/scheduler_worker_pool_impl.cc
+++ b/base/task_scheduler/scheduler_worker_pool_impl.cc
@@ -238,7 +238,8 @@ class SchedulerWorkerPoolImpl::SchedulerWorkerDelegateImpl
void OnMainEntry(SchedulerWorker* worker,
const TimeDelta& detach_duration) override;
scoped_refptr<Sequence> GetWork(SchedulerWorker* worker) override;
- void DidRunTask(const Task* task, const TimeDelta& task_latency) override;
+ void DidRunTaskWithPriority(TaskPriority task_priority,
+ const TimeDelta& task_latency) override;
void ReEnqueueSequence(scoped_refptr<Sequence> sequence) override;
TimeDelta GetSleepTimeout() override;
bool CanDetach(SchedulerWorker* worker) override;
@@ -588,12 +589,12 @@ SchedulerWorkerPoolImpl::SchedulerWorkerDelegateImpl::GetWork(
return sequence;
}
-void SchedulerWorkerPoolImpl::SchedulerWorkerDelegateImpl::DidRunTask(
- const Task* task,
- const TimeDelta& task_latency) {
+void SchedulerWorkerPoolImpl::SchedulerWorkerDelegateImpl::
+ DidRunTaskWithPriority(TaskPriority task_priority,
+ const TimeDelta& task_latency) {
++num_tasks_since_last_wait_;
- const int priority_index = static_cast<int>(task->traits.priority());
+ const int priority_index = static_cast<int>(task_priority);
// As explained in the header file, histograms are allocated on demand. It
// doesn't matter if an element of |task_latency_histograms_| is set multiple
@@ -603,7 +604,7 @@ void SchedulerWorkerPoolImpl::SchedulerWorkerDelegateImpl::DidRunTask(
subtle::Acquire_Load(&outer_->task_latency_histograms_[priority_index]));
if (!task_latency_histogram) {
task_latency_histogram =
- GetTaskLatencyHistogram(outer_->name_, task->traits.priority());
+ GetTaskLatencyHistogram(outer_->name_, task_priority);
subtle::Release_Store(
&outer_->task_latency_histograms_[priority_index],
reinterpret_cast<subtle::AtomicWord>(task_latency_histogram));
« no previous file with comments | « base/task_scheduler/scheduler_worker.cc ('k') | base/task_scheduler/scheduler_worker_stack_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698