Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_SCHEDULER_CHILD_SCHEDULER_TASK_RUNNER_DELEGATE_H_ | 5 #ifndef COMPONENTS_SCHEDULER_CHILD_SCHEDULER_TASK_RUNNER_DELEGATE_H_ |
| 6 #define COMPONENTS_SCHEDULER_CHILD_SCHEDULER_TASK_RUNNER_DELEGATE_H_ | 6 #define COMPONENTS_SCHEDULER_CHILD_SCHEDULER_TASK_RUNNER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "components/scheduler/base/nestable_single_thread_task_runner.h" | 9 #include "components/scheduler/base/task_queue_manager_delegate.h" |
| 10 #include "components/scheduler/scheduler_export.h" | 10 #include "components/scheduler/scheduler_export.h" |
| 11 | 11 |
| 12 namespace scheduler { | 12 namespace scheduler { |
| 13 | 13 |
| 14 class SCHEDULER_EXPORT SchedulerTaskRunnerDelegate | 14 class SCHEDULER_EXPORT SchedulerTaskRunnerDelegate |
|
Sami
2015/10/30 11:11:20
Should this now be called SchedulerTaskQueueManage
alex clarke (OOO till 29th)
2015/10/30 12:12:24
Done.
| |
| 15 : public NestableSingleThreadTaskRunner { | 15 : public TaskQueueManagerDelegate { |
| 16 public: | 16 public: |
| 17 SchedulerTaskRunnerDelegate() {} | 17 SchedulerTaskRunnerDelegate() {} |
| 18 | 18 |
| 19 // If the underlying task runner supports the concept of a default task | 19 // If the underlying task runner supports the concept of a default task |
| 20 // runner, the delegate should implement this function to redirect that task | 20 // runner, the delegate should implement this function to redirect that task |
| 21 // runner to the scheduler. | 21 // runner to the scheduler. |
| 22 virtual void SetDefaultTaskRunner( | 22 virtual void SetDefaultTaskRunner( |
| 23 scoped_refptr<base::SingleThreadTaskRunner> task_runner) = 0; | 23 scoped_refptr<base::SingleThreadTaskRunner> task_runner) = 0; |
| 24 | 24 |
| 25 // Similarly this method can be used to restore the original task runner when | 25 // Similarly this method can be used to restore the original task runner when |
| 26 // the scheduler no longer wants to intercept tasks. | 26 // the scheduler no longer wants to intercept tasks. |
| 27 virtual void RestoreDefaultTaskRunner() = 0; | 27 virtual void RestoreDefaultTaskRunner() = 0; |
| 28 | 28 |
| 29 protected: | 29 protected: |
| 30 ~SchedulerTaskRunnerDelegate() override {} | 30 ~SchedulerTaskRunnerDelegate() override {} |
| 31 | 31 |
| 32 DISALLOW_COPY_AND_ASSIGN(SchedulerTaskRunnerDelegate); | 32 DISALLOW_COPY_AND_ASSIGN(SchedulerTaskRunnerDelegate); |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 } // namespace scheduler | 35 } // namespace scheduler |
| 36 | 36 |
| 37 #endif // COMPONENTS_SCHEDULER_CHILD_SCHEDULER_TASK_RUNNER_DELEGATE_H_ | 37 #endif // COMPONENTS_SCHEDULER_CHILD_SCHEDULER_TASK_RUNNER_DELEGATE_H_ |
| OLD | NEW |