| 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_CHILD_SCHEDULER_H_ | 5 #ifndef COMPONENTS_SCHEDULER_CHILD_CHILD_SCHEDULER_H_ |
| 6 #define COMPONENTS_SCHEDULER_CHILD_CHILD_SCHEDULER_H_ | 6 #define COMPONENTS_SCHEDULER_CHILD_CHILD_SCHEDULER_H_ |
| 7 | 7 |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "components/scheduler/child/single_thread_idle_task_runner.h" | 9 #include "components/scheduler/child/single_thread_idle_task_runner.h" |
| 10 #include "components/scheduler/child/task_queue.h" |
| 10 #include "components/scheduler/scheduler_export.h" | 11 #include "components/scheduler/scheduler_export.h" |
| 11 | 12 |
| 12 namespace base { | 13 namespace base { |
| 13 class MessageLoop; | 14 class MessageLoop; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace scheduler { | 17 namespace scheduler { |
| 17 | 18 |
| 18 class SCHEDULER_EXPORT ChildScheduler { | 19 class SCHEDULER_EXPORT ChildScheduler { |
| 19 public: | 20 public: |
| 20 virtual ~ChildScheduler() {} | 21 virtual ~ChildScheduler() {} |
| 21 | 22 |
| 22 // Returns the default task runner. | 23 // Returns the default task runner. |
| 23 virtual scoped_refptr<base::SingleThreadTaskRunner> DefaultTaskRunner() = 0; | 24 virtual scoped_refptr<TaskQueue> DefaultTaskRunner() = 0; |
| 24 | 25 |
| 25 // Returns the idle task runner. Tasks posted to this runner may be reordered | 26 // Returns the idle task runner. Tasks posted to this runner may be reordered |
| 26 // relative to other task types and may be starved for an arbitrarily long | 27 // relative to other task types and may be starved for an arbitrarily long |
| 27 // time if no idle time is available. | 28 // time if no idle time is available. |
| 28 virtual scoped_refptr<SingleThreadIdleTaskRunner> IdleTaskRunner() = 0; | 29 virtual scoped_refptr<SingleThreadIdleTaskRunner> IdleTaskRunner() = 0; |
| 29 | 30 |
| 30 // Returns true if there is high priority work pending on the main thread | 31 // Returns true if there is high priority work pending on the main thread |
| 31 // and the caller should yield to let the scheduler service that work. Note | 32 // and the caller should yield to let the scheduler service that work. Note |
| 32 // that this is a stricter condition than |IsHighPriorityWorkAnticipated|, | 33 // that this is a stricter condition than |IsHighPriorityWorkAnticipated|, |
| 33 // restricted to the case where real work is pending. | 34 // restricted to the case where real work is pending. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 58 virtual void Shutdown() = 0; | 59 virtual void Shutdown() = 0; |
| 59 | 60 |
| 60 protected: | 61 protected: |
| 61 ChildScheduler() {} | 62 ChildScheduler() {} |
| 62 DISALLOW_COPY_AND_ASSIGN(ChildScheduler); | 63 DISALLOW_COPY_AND_ASSIGN(ChildScheduler); |
| 63 }; | 64 }; |
| 64 | 65 |
| 65 } // namespace scheduler | 66 } // namespace scheduler |
| 66 | 67 |
| 67 #endif // COMPONENTS_SCHEDULER_CHILD_CHILD_SCHEDULER_H_ | 68 #endif // COMPONENTS_SCHEDULER_CHILD_CHILD_SCHEDULER_H_ |
| OLD | NEW |