Index: base/task_scheduler/scheduler_thread_pool.h |
diff --git a/base/task_scheduler/scheduler_thread_pool.h b/base/task_scheduler/scheduler_thread_pool.h |
index bd85108b860a27f20aef6364e73c4be6317a75d4..0eb4edf19266f29016e2d9d547d550da6aa8dee2 100644 |
--- a/base/task_scheduler/scheduler_thread_pool.h |
+++ b/base/task_scheduler/scheduler_thread_pool.h |
@@ -27,6 +27,7 @@ |
namespace base { |
namespace internal { |
+class DelayedTaskManager; |
struct SequenceSortKey; |
class TaskTracker; |
@@ -39,14 +40,17 @@ class BASE_EXPORT SchedulerThreadPool { |
// Creates a SchedulerThreadPool with up to |max_threads| threads of priority |
// |thread_priority|. |enqueue_sequence_callback| will be invoked after a |
- // thread of this thread pool tries to run a Task. |task_tracker| is used to |
- // handle shutdown behavior of Tasks. Returns nullptr on failure to create a |
- // thread pool with at least one thread. |
+ // thread of this thread pool tries to run a Task. Tasks posted to TaskRunners |
+ // returned by CreateTaskRunnerWithTraits with a delay are handled by |
+ // |delayed_task_manager|. |task_tracker| handles shutdown behavior of Tasks. |
+ // Returns nullptr on failure to create a thread pool with at least one |
+ // thread. |
static std::unique_ptr<SchedulerThreadPool> CreateThreadPool( |
ThreadPriority thread_priority, |
size_t max_threads, |
const EnqueueSequenceCallback& enqueue_sequence_callback, |
- TaskTracker* task_tracker); |
+ TaskTracker* task_tracker, |
+ DelayedTaskManager* delayed_task_manager); |
// Destroying a SchedulerThreadPool returned by CreateThreadPool() is not |
// allowed in production; it is always leaked. In tests, it can only be |
@@ -77,7 +81,8 @@ class BASE_EXPORT SchedulerThreadPool { |
class SchedulerWorkerThreadDelegateImpl; |
SchedulerThreadPool(const EnqueueSequenceCallback& enqueue_sequence_callback, |
- TaskTracker* task_tracker); |
+ TaskTracker* task_tracker, |
+ DelayedTaskManager* delayed_task_manager); |
bool Initialize(ThreadPriority thread_priority, size_t max_threads); |
@@ -113,6 +118,7 @@ class BASE_EXPORT SchedulerThreadPool { |
std::unique_ptr<SchedulerWorkerThread::Delegate> worker_thread_delegate_; |
TaskTracker* const task_tracker_; |
+ DelayedTaskManager* const delayed_task_manager_; |
DISALLOW_COPY_AND_ASSIGN(SchedulerThreadPool); |
}; |