| 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_CHILD_SCHEDULER_TQM_DELEGAT
E_H_ | 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_TQM_DELEGAT
E_H_ |
| 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_TQM_DELEGAT
E_H_ | 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_TQM_DELEGAT
E_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "platform/scheduler/base/task_queue_manager_delegate.h" | 10 #include "platform/scheduler/base/task_queue_manager_delegate.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 namespace scheduler { | 13 namespace scheduler { |
| 14 | 14 |
| 15 class BLINK_PLATFORM_EXPORT SchedulerTqmDelegate | 15 class PLATFORM_EXPORT SchedulerTqmDelegate : public TaskQueueManagerDelegate { |
| 16 : public TaskQueueManagerDelegate { | |
| 17 public: | 16 public: |
| 18 SchedulerTqmDelegate() {} | 17 SchedulerTqmDelegate() {} |
| 19 | 18 |
| 20 // 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 |
| 21 // runner, the delegate should implement this function to redirect that task | 20 // runner, the delegate should implement this function to redirect that task |
| 22 // runner to the scheduler. | 21 // runner to the scheduler. |
| 23 virtual void SetDefaultTaskRunner( | 22 virtual void SetDefaultTaskRunner( |
| 24 scoped_refptr<base::SingleThreadTaskRunner> task_runner) = 0; | 23 scoped_refptr<base::SingleThreadTaskRunner> task_runner) = 0; |
| 25 | 24 |
| 26 // 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 |
| 27 // the scheduler no longer wants to intercept tasks. | 26 // the scheduler no longer wants to intercept tasks. |
| 28 virtual void RestoreDefaultTaskRunner() = 0; | 27 virtual void RestoreDefaultTaskRunner() = 0; |
| 29 | 28 |
| 30 protected: | 29 protected: |
| 31 ~SchedulerTqmDelegate() override {} | 30 ~SchedulerTqmDelegate() override {} |
| 32 | 31 |
| 33 DISALLOW_COPY_AND_ASSIGN(SchedulerTqmDelegate); | 32 DISALLOW_COPY_AND_ASSIGN(SchedulerTqmDelegate); |
| 34 }; | 33 }; |
| 35 | 34 |
| 36 } // namespace scheduler | 35 } // namespace scheduler |
| 37 } // namespace blink | 36 } // namespace blink |
| 38 | 37 |
| 39 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_TQM_DELE
GATE_H_ | 38 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_TQM_DELE
GATE_H_ |
| OLD | NEW |