Index: components/scheduler/child/scheduler_helper.h |
diff --git a/components/scheduler/child/scheduler_helper.h b/components/scheduler/child/scheduler_helper.h |
index 7ace6944c42b3d8ab5d0403f4bdd28c2fb46f73d..8b0d9bdf514d4c8de36819a700412137067fedae 100644 |
--- a/components/scheduler/child/scheduler_helper.h |
+++ b/components/scheduler/child/scheduler_helper.h |
@@ -61,6 +61,10 @@ class SCHEDULER_EXPORT SchedulerHelper { |
// time if no idle time is available. |
scoped_refptr<SingleThreadIdleTaskRunner> IdleTaskRunner(); |
+ // Returns the shutdown task runner. Intended for tasks that must be able to |
+ // run, even after PreShutdown() is called. |
+ scoped_refptr<base::SingleThreadTaskRunner> ShutdownTaskRunner(); |
+ |
// Returns the control task runner. Tasks posted to this runner are executed |
// with the highest priority. Care must be taken to avoid starvation of other |
// task queues. |
@@ -82,6 +86,11 @@ class SCHEDULER_EXPORT SchedulerHelper { |
void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer); |
void RemoveTaskObserver(base::MessageLoop::TaskObserver* task_observer); |
+ // Optional. This stops all queues except for shutdown and control queues. |
+ // Also ends any idle periods. Must be called from the thread this class was |
+ // created on. |
+ void PreShutdown(); |
+ |
// Shuts down the scheduler by dropping any remaining pending work in the work |
// queues. After this call any work posted to the task runners will be |
// silently dropped. |
@@ -94,6 +103,7 @@ class SCHEDULER_EXPORT SchedulerHelper { |
enum QueueId { |
DEFAULT_TASK_QUEUE, |
IDLE_TASK_QUEUE, |
+ SHUTDOWN_TASK_QUEUE, |
CONTROL_TASK_QUEUE, |
CONTROL_TASK_AFTER_WAKEUP_QUEUE, |
// Must be the last entry. |
@@ -190,8 +200,11 @@ class SCHEDULER_EXPORT SchedulerHelper { |
scoped_refptr<base::SingleThreadTaskRunner> control_task_runner_; |
scoped_refptr<base::SingleThreadTaskRunner> control_task_after_wakeup_runner_; |
scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_; |
+ scoped_refptr<base::SingleThreadTaskRunner> shutdown_task_runner_; |
scoped_refptr<SingleThreadIdleTaskRunner> idle_task_runner_; |
+ size_t total_task_queue_count_; |
+ |
// A bitmap which controls the set of queues that are checked for quiescence |
// before triggering a long idle period. |
uint64 quiescence_monitored_task_queue_mask_; |