| 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..f33c5c0b34d0f2b8f5c06ce597de92c082892c06 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. If posted from a different thread, it blocks
|
| + // until the thread this class was created on has completed the pre-shutdown.
|
| + 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.
|
| @@ -175,6 +185,7 @@ class SCHEDULER_EXPORT SchedulerHelper {
|
|
|
| bool ShouldWaitForQuiescence();
|
| void EnableLongIdlePeriodAfterWakeup();
|
| + void PreShutdownInternal(base::WaitableEvent* completion);
|
|
|
| base::ThreadChecker thread_checker_;
|
| scoped_ptr<PrioritizingTaskQueueSelector> task_queue_selector_;
|
| @@ -190,8 +201,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_;
|
|
|