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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 // are executed with the highest priority but do not cause the scheduler to | 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. | 52 // wake up. Care must be taken to avoid starvation of other task queues. |
53 scoped_refptr<TaskQueue> ControlAfterWakeUpTaskRunner(); | 53 scoped_refptr<TaskQueue> ControlAfterWakeUpTaskRunner(); |
54 | 54 |
55 // Adds or removes a task observer from the scheduler. The observer will be | 55 // 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 | 56 // notified before and after every executed task. These functions can only be |
57 // called on the thread this class was created on. | 57 // called on the thread this class was created on. |
58 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer); | 58 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer); |
59 void RemoveTaskObserver(base::MessageLoop::TaskObserver* task_observer); | 59 void RemoveTaskObserver(base::MessageLoop::TaskObserver* task_observer); |
60 | 60 |
61 void SetTaskTimeTracker(TaskTimeTracker* task_time_tracker) { | 61 void AddTaskTimeObserver(TaskTimeObserver* task_time_observer) { |
Sami
2016/08/26 16:08:56
nit: Please implement these in the .cc instead.
panicker
2016/08/26 16:24:48
Done.
| |
62 if (task_queue_manager_) | 62 if (task_queue_manager_) |
63 task_queue_manager_->SetTaskTimeTracker(task_time_tracker); | 63 task_queue_manager_->AddTaskTimeObserver(task_time_observer); |
64 } | |
65 | |
66 void RemoveTaskTimeObserver(TaskTimeObserver* task_time_observer) { | |
67 if (task_queue_manager_) | |
68 task_queue_manager_->RemoveTaskTimeObserver(task_time_observer); | |
64 } | 69 } |
65 | 70 |
66 // Shuts down the scheduler by dropping any remaining pending work in the work | 71 // Shuts down the scheduler by dropping any remaining pending work in the work |
67 // queues. After this call any work posted to the task runners will be | 72 // queues. After this call any work posted to the task runners will be |
68 // silently dropped. | 73 // silently dropped. |
69 void Shutdown(); | 74 void Shutdown(); |
70 | 75 |
71 // Returns true if Shutdown() has been called. Otherwise returns false. | 76 // Returns true if Shutdown() has been called. Otherwise returns false. |
72 bool IsShutdown() const { return !task_queue_manager_.get(); } | 77 bool IsShutdown() const { return !task_queue_manager_.get(); } |
73 | 78 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
123 const char* tracing_category_; | 128 const char* tracing_category_; |
124 const char* disabled_by_default_tracing_category_; | 129 const char* disabled_by_default_tracing_category_; |
125 | 130 |
126 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper); | 131 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper); |
127 }; | 132 }; |
128 | 133 |
129 } // namespace scheduler | 134 } // namespace scheduler |
130 } // namespace blink | 135 } // namespace blink |
131 | 136 |
132 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_HELPER_H _ | 137 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_HELPER_H _ |
OLD | NEW |