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

Side by Side Diff: base/task_scheduler/scheduler_worker_pool_impl.cc

Issue 2405243003: TaskScheduler: Replace the SchedulerServiceThread with a base::Thread. (Closed)
Patch Set: CR robliao #9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/task_scheduler/scheduler_worker_pool_impl.h" 5 #include "base/task_scheduler/scheduler_worker_pool_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 void SchedulerWorkerPoolImpl::PostTaskWithSequenceNow( 409 void SchedulerWorkerPoolImpl::PostTaskWithSequenceNow(
410 std::unique_ptr<Task> task, 410 std::unique_ptr<Task> task,
411 scoped_refptr<Sequence> sequence, 411 scoped_refptr<Sequence> sequence,
412 SchedulerWorker* worker) { 412 SchedulerWorker* worker) {
413 DCHECK(task); 413 DCHECK(task);
414 DCHECK(sequence); 414 DCHECK(sequence);
415 DCHECK(!worker || ContainsWorker(workers_, worker)); 415 DCHECK(!worker || ContainsWorker(workers_, worker));
416 416
417 // Confirm that |task| is ready to run (its delayed run time is either null or 417 // Confirm that |task| is ready to run (its delayed run time is either null or
418 // in the past). 418 // in the past).
419 DCHECK_LE(task->delayed_run_time, delayed_task_manager_->Now()); 419 DCHECK_LE(task->delayed_run_time, TimeTicks::Now());
420 420
421 // Because |worker| belongs to this worker pool, we know that the type 421 // Because |worker| belongs to this worker pool, we know that the type
422 // of its delegate is SchedulerWorkerDelegateImpl. 422 // of its delegate is SchedulerWorkerDelegateImpl.
423 PriorityQueue* const priority_queue = 423 PriorityQueue* const priority_queue =
424 worker 424 worker
425 ? static_cast<SchedulerWorkerDelegateImpl*>(worker->delegate()) 425 ? static_cast<SchedulerWorkerDelegateImpl*>(worker->delegate())
426 ->single_threaded_priority_queue() 426 ->single_threaded_priority_queue()
427 : &shared_priority_queue_; 427 : &shared_priority_queue_;
428 DCHECK(priority_queue); 428 DCHECK(priority_queue);
429 429
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 AutoSchedulerLock auto_lock(idle_workers_stack_lock_); 786 AutoSchedulerLock auto_lock(idle_workers_stack_lock_);
787 idle_workers_stack_.Remove(worker); 787 idle_workers_stack_.Remove(worker);
788 } 788 }
789 789
790 bool SchedulerWorkerPoolImpl::CanWorkerDetachForTesting() { 790 bool SchedulerWorkerPoolImpl::CanWorkerDetachForTesting() {
791 return !worker_detachment_disallowed_.IsSet(); 791 return !worker_detachment_disallowed_.IsSet();
792 } 792 }
793 793
794 } // namespace internal 794 } // namespace internal
795 } // namespace base 795 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698