| 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_HELPER_H_ | 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ |
| 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ | 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 const base::PendingTask& task) override; | 40 const base::PendingTask& task) override; |
| 41 | 41 |
| 42 // Returns the default task runner. | 42 // Returns the default task runner. |
| 43 scoped_refptr<TaskQueue> DefaultTaskRunner(); | 43 scoped_refptr<TaskQueue> DefaultTaskRunner(); |
| 44 | 44 |
| 45 // Returns the control task runner. Tasks posted to this runner are executed | 45 // Returns the control task runner. Tasks posted to this runner are executed |
| 46 // with the highest priority. Care must be taken to avoid starvation of other | 46 // with the highest priority. Care must be taken to avoid starvation of other |
| 47 // task queues. | 47 // task queues. |
| 48 scoped_refptr<TaskQueue> ControlTaskRunner(); | 48 scoped_refptr<TaskQueue> ControlTaskRunner(); |
| 49 | 49 |
| 50 // Returns the control task after wakeup runner. Tasks posted to this runner | |
| 51 // are executed with the highest priority but do not cause the scheduler to | |
| 52 // wake up. Care must be taken to avoid starvation of other task queues. | |
| 53 scoped_refptr<TaskQueue> ControlAfterWakeUpTaskRunner(); | |
| 54 | |
| 55 // Adds or removes a task observer from the scheduler. The observer will be | 50 // Adds or removes a task observer from the scheduler. The observer will be |
| 56 // notified before and after every executed task. These functions can only be | 51 // notified before and after every executed task. These functions can only be |
| 57 // called on the thread this class was created on. | 52 // called on the thread this class was created on. |
| 58 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer); | 53 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer); |
| 59 void RemoveTaskObserver(base::MessageLoop::TaskObserver* task_observer); | 54 void RemoveTaskObserver(base::MessageLoop::TaskObserver* task_observer); |
| 60 | 55 |
| 61 void SetTaskTimeTracker(TaskTimeTracker* task_time_tracker) { | 56 void SetTaskTimeTracker(TaskTimeTracker* task_time_tracker) { |
| 62 if (task_queue_manager_) | 57 if (task_queue_manager_) |
| 63 task_queue_manager_->SetTaskTimeTracker(task_time_tracker); | 58 task_queue_manager_->SetTaskTimeTracker(task_time_tracker); |
| 64 } | 59 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 void SetWorkBatchSizeForTesting(size_t work_batch_size); | 104 void SetWorkBatchSizeForTesting(size_t work_batch_size); |
| 110 TaskQueueManager* GetTaskQueueManagerForTesting(); | 105 TaskQueueManager* GetTaskQueueManagerForTesting(); |
| 111 | 106 |
| 112 private: | 107 private: |
| 113 friend class SchedulerHelperTest; | 108 friend class SchedulerHelperTest; |
| 114 | 109 |
| 115 base::ThreadChecker thread_checker_; | 110 base::ThreadChecker thread_checker_; |
| 116 scoped_refptr<SchedulerTqmDelegate> task_queue_manager_delegate_; | 111 scoped_refptr<SchedulerTqmDelegate> task_queue_manager_delegate_; |
| 117 std::unique_ptr<TaskQueueManager> task_queue_manager_; | 112 std::unique_ptr<TaskQueueManager> task_queue_manager_; |
| 118 scoped_refptr<TaskQueue> control_task_runner_; | 113 scoped_refptr<TaskQueue> control_task_runner_; |
| 119 scoped_refptr<TaskQueue> control_after_wakeup_task_runner_; | |
| 120 scoped_refptr<TaskQueue> default_task_runner_; | 114 scoped_refptr<TaskQueue> default_task_runner_; |
| 121 | 115 |
| 122 Observer* observer_; // NOT OWNED | 116 Observer* observer_; // NOT OWNED |
| 123 const char* tracing_category_; | 117 const char* tracing_category_; |
| 124 const char* disabled_by_default_tracing_category_; | 118 const char* disabled_by_default_tracing_category_; |
| 125 | 119 |
| 126 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper); | 120 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper); |
| 127 }; | 121 }; |
| 128 | 122 |
| 129 } // namespace scheduler | 123 } // namespace scheduler |
| 130 } // namespace blink | 124 } // namespace blink |
| 131 | 125 |
| 132 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_HELPER_H
_ | 126 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_HELPER_H
_ |
| OLD | NEW |