| 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 THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_DEL
EGATE_H_ | 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_DEL
EGATE_H_ |
| 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_DEL
EGATE_H_ | 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_DEL
EGATE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "base/time/tick_clock.h" | 11 #include "base/time/tick_clock.h" |
| 12 #include "platform/PlatformExport.h" | 12 #include "platform/PlatformExport.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 namespace scheduler { | 15 namespace scheduler { |
| 16 | 16 |
| 17 class PLATFORM_EXPORT TaskQueueManagerDelegate | 17 class PLATFORM_EXPORT TaskQueueManagerDelegate |
| 18 : public base::SingleThreadTaskRunner, | 18 : public base::SingleThreadTaskRunner, |
| 19 public base::TickClock { | 19 public base::TickClock { |
| 20 public: | 20 public: |
| 21 TaskQueueManagerDelegate() {} | 21 TaskQueueManagerDelegate() {} |
| 22 | 22 |
| 23 // Returns true if the task runner is nested (i.e., running a run loop within | 23 // Returns true if the task runner is nested (i.e., running a run loop within |
| 24 // a nested task). | 24 // a nested task). |
| 25 virtual bool IsNested() const = 0; | 25 virtual bool IsNested() const = 0; |
| 26 | 26 |
| 27 // A NestingObserver is notified when a nested message loop begins. The | 27 // A NestingObserver is notified when a nested message loop begins. The |
| 28 // observers are notified before the first task is processed. | 28 // observers are notified before the first task is processed. |
| 29 virtual void AddNestingObserver( | 29 virtual void AddNestingObserver(base::RunLoop::NestingObserver* observer) = 0; |
| 30 base::MessageLoop::NestingObserver* observer) = 0; | |
| 31 | 30 |
| 32 virtual void RemoveNestingObserver( | 31 virtual void RemoveNestingObserver( |
| 33 base::MessageLoop::NestingObserver* observer) = 0; | 32 base::RunLoop::NestingObserver* observer) = 0; |
| 34 | 33 |
| 35 protected: | 34 protected: |
| 36 ~TaskQueueManagerDelegate() override {} | 35 ~TaskQueueManagerDelegate() override {} |
| 37 | 36 |
| 38 DISALLOW_COPY_AND_ASSIGN(TaskQueueManagerDelegate); | 37 DISALLOW_COPY_AND_ASSIGN(TaskQueueManagerDelegate); |
| 39 }; | 38 }; |
| 40 | 39 |
| 41 } // namespace scheduler | 40 } // namespace scheduler |
| 42 } // namespace blink | 41 } // namespace blink |
| 43 | 42 |
| 44 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_
DELEGATE_H_ | 43 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_MANAGER_
DELEGATE_H_ |
| OLD | NEW |