Index: components/scheduler/child/scheduler_helper.h |
diff --git a/components/scheduler/child/scheduler_helper.h b/components/scheduler/child/scheduler_helper.h |
index 3cb6997f8bae7e7a3560282276b64c58b18309f3..8cd0f5b96e253da657003af465b43d0e93cae743 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,10 @@ 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 the shutdown queue. 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 +102,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. |
@@ -195,8 +204,12 @@ 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_; |
+ bool in_preshutdown_; |
+ |
// 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_; |