| OLD | NEW |
| 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 #ifndef BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_H_ | 5 #ifndef BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_H_ |
| 6 #define BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_H_ | 6 #define BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/task_runner.h" | 12 #include "base/task_runner.h" |
| 13 #include "base/task_scheduler/sequence.h" | 13 #include "base/task_scheduler/sequence.h" |
| 14 #include "base/task_scheduler/task.h" | 14 #include "base/task_scheduler/task.h" |
| 15 #include "base/task_scheduler/task_traits.h" | 15 #include "base/task_scheduler/task_traits.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 namespace internal { | 18 namespace internal { |
| 19 | 19 |
| 20 class SchedulerWorkerThread; | 20 class SchedulerWorkerThread; |
| 21 struct SequenceSortKey; | 21 class SequenceSortKey; |
| 22 | 22 |
| 23 // Interface for a thread pool. | 23 // Interface for a thread pool. |
| 24 class BASE_EXPORT SchedulerThreadPool { | 24 class BASE_EXPORT SchedulerThreadPool { |
| 25 public: | 25 public: |
| 26 virtual ~SchedulerThreadPool() = default; | 26 virtual ~SchedulerThreadPool() = default; |
| 27 | 27 |
| 28 // Returns a TaskRunner whose PostTask invocations will result in scheduling | 28 // Returns a TaskRunner whose PostTask invocations will result in scheduling |
| 29 // Tasks with |traits| and |execution_mode| in this thread pool. | 29 // Tasks with |traits| and |execution_mode| in this thread pool. |
| 30 virtual scoped_refptr<TaskRunner> CreateTaskRunnerWithTraits( | 30 virtual scoped_refptr<TaskRunner> CreateTaskRunnerWithTraits( |
| 31 const TaskTraits& traits, | 31 const TaskTraits& traits, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 57 virtual void PostTaskWithSequenceNow( | 57 virtual void PostTaskWithSequenceNow( |
| 58 std::unique_ptr<Task> task, | 58 std::unique_ptr<Task> task, |
| 59 scoped_refptr<Sequence> sequence, | 59 scoped_refptr<Sequence> sequence, |
| 60 SchedulerWorkerThread* worker_thread) = 0; | 60 SchedulerWorkerThread* worker_thread) = 0; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 } // namespace internal | 63 } // namespace internal |
| 64 } // namespace base | 64 } // namespace base |
| 65 | 65 |
| 66 #endif // BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_H_ | 66 #endif // BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_H_ |
| OLD | NEW |