Chromium Code Reviews| Index: base/task_scheduler/scheduler_thread_pool.cc |
| diff --git a/base/task_scheduler/scheduler_thread_pool.cc b/base/task_scheduler/scheduler_thread_pool.cc |
| index a6ee6bad9074fe14e9d6f99080776d64bf517961..203877d6dc4fe938d23c41cea86d4860cae2f036 100644 |
| --- a/base/task_scheduler/scheduler_thread_pool.cc |
| +++ b/base/task_scheduler/scheduler_thread_pool.cc |
| @@ -131,8 +131,9 @@ class SchedulerThreadPool::SchedulerWorkerThreadDelegateImpl |
| // SchedulerWorkerThread::Delegate: |
| void OnMainEntry() override; |
| - scoped_refptr<Sequence> GetWork( |
| - SchedulerWorkerThread* worker_thread) override; |
| + scoped_refptr<Sequence> GetWork(SchedulerWorkerThread* worker_thread, |
| + PriorityQueue* alternate_priority_queue, |
| + bool* alternate_priority_queue_used) override; |
| void EnqueueSequence(scoped_refptr<Sequence> sequence) override; |
| private: |
| @@ -247,7 +248,12 @@ void SchedulerThreadPool::SchedulerWorkerThreadDelegateImpl::OnMainEntry() { |
| scoped_refptr<Sequence> |
| SchedulerThreadPool::SchedulerWorkerThreadDelegateImpl::GetWork( |
| - SchedulerWorkerThread* worker_thread) { |
| + SchedulerWorkerThread* worker_thread, |
| + PriorityQueue* alternate_priority_queue, |
|
danakj
2016/04/20 23:16:16
I would not add these arguments until you're going
fdoray
2016/04/21 19:31:28
n/a with the latest patch set
|
| + bool* alternate_priority_queue_used) { |
| + // TODO(fdoray): Return a Sequence from |alternate_priority_queue| when |
| + // appropriate. |
| + |
| std::unique_ptr<PriorityQueue::Transaction> transaction( |
| outer_->shared_priority_queue_.BeginTransaction()); |
| const auto& sequence_and_sort_key = transaction->Peek(); |
| @@ -305,7 +311,8 @@ bool SchedulerThreadPool::Initialize(ThreadPriority thread_priority, |
| for (size_t i = 0; i < max_threads; ++i) { |
| std::unique_ptr<SchedulerWorkerThread> worker_thread = |
| SchedulerWorkerThread::CreateSchedulerWorkerThread( |
| - thread_priority, worker_thread_delegate_.get(), task_tracker_); |
| + thread_priority, worker_thread_delegate_.get(), task_tracker_, |
| + delayed_task_manager_, &shared_priority_queue_); |
| if (!worker_thread) |
| break; |
| idle_worker_threads_stack_.push(worker_thread.get()); |