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

Unified Diff: base/task_scheduler/scheduler_thread_pool.h

Issue 1806473002: TaskScheduler [9] Delayed Task Manager (Closed) Base URL: https://luckyluke-private.googlesource.com/src@s_5_worker_thread
Patch Set: CR danakj #29 Created 4 years, 8 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/delayed_task_manager_unittest.cc ('k') | base/task_scheduler/scheduler_thread_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f7919dfe7bf0cf3b3bf8229090d7428d6d4acf4e..75c8a3290cfbc2cb9c2a60a6a40ef8510a841b13 100644
--- a/base/task_scheduler/scheduler_thread_pool.h
+++ b/base/task_scheduler/scheduler_thread_pool.h
@@ -29,6 +29,7 @@
namespace base {
namespace internal {
+class DelayedTaskManager;
struct SequenceSortKey;
class TaskTracker;
@@ -47,13 +48,15 @@ class BASE_EXPORT SchedulerThreadPool : public SchedulerTaskExecutor {
// 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.
+ // handle shutdown behavior of Tasks. |delayed_task_manager| handles Tasks
+ // posted with a delay. 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);
// Returns a TaskRunner whose PostTask invocations will result in scheduling
// Tasks with |traits| and |execution_mode| in this thread pool.
@@ -83,7 +86,8 @@ class BASE_EXPORT SchedulerThreadPool : public SchedulerTaskExecutor {
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);
@@ -124,6 +128,7 @@ class BASE_EXPORT SchedulerThreadPool : public SchedulerTaskExecutor {
std::unique_ptr<SchedulerWorkerThread::Delegate> worker_thread_delegate_;
TaskTracker* const task_tracker_;
+ DelayedTaskManager* const delayed_task_manager_;
DISALLOW_COPY_AND_ASSIGN(SchedulerThreadPool);
};
« no previous file with comments | « base/task_scheduler/delayed_task_manager_unittest.cc ('k') | base/task_scheduler/scheduler_thread_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698