Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_ | 5 #ifndef CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_ |
| 6 #define CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_ | 6 #define CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/atomic_sequence_num.h" | 8 #include "base/atomic_sequence_num.h" |
| 9 #include "base/debug/task_annotator.h" | 9 #include "base/debug/task_annotator.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 MANUAL | 66 MANUAL |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 // Create a task queue manager with |task_queue_count| task queues. | 69 // Create a task queue manager with |task_queue_count| task queues. |
| 70 // |main_task_runner| identifies the thread on which where the tasks are | 70 // |main_task_runner| identifies the thread on which where the tasks are |
| 71 // eventually run. |selector| is used to choose which task queue to service. | 71 // eventually run. |selector| is used to choose which task queue to service. |
| 72 // It should outlive this class. | 72 // It should outlive this class. |
| 73 TaskQueueManager( | 73 TaskQueueManager( |
| 74 size_t task_queue_count, | 74 size_t task_queue_count, |
| 75 scoped_refptr<NestableSingleThreadTaskRunner> main_task_runner, | 75 scoped_refptr<NestableSingleThreadTaskRunner> main_task_runner, |
| 76 TaskQueueSelector* selector); | 76 TaskQueueSelector* selector, |
| 77 const char* disabled_by_default_tracing_category); | |
|
rmcilroy
2015/03/27 14:34:40
and here
alex clarke (OOO till 29th)
2015/03/27 16:09:17
Done.
| |
| 77 ~TaskQueueManager(); | 78 ~TaskQueueManager(); |
| 78 | 79 |
| 79 // Returns the task runner which targets the queue selected by |queue_index|. | 80 // Returns the task runner which targets the queue selected by |queue_index|. |
| 80 scoped_refptr<base::SingleThreadTaskRunner> TaskRunnerForQueue( | 81 scoped_refptr<base::SingleThreadTaskRunner> TaskRunnerForQueue( |
| 81 size_t queue_index) const; | 82 size_t queue_index) const; |
| 82 | 83 |
| 83 // Sets the pump policy for the |queue_index| to |pump_policy|. By | 84 // Sets the pump policy for the |queue_index| to |pump_policy|. By |
| 84 // default queues are created with AUTO_PUMP_POLICY. | 85 // default queues are created with AUTO_PUMP_POLICY. |
| 85 void SetPumpPolicy(size_t queue_index, PumpPolicy pump_policy); | 86 void SetPumpPolicy(size_t queue_index, PumpPolicy pump_policy); |
| 86 | 87 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 // The pending_dowork_count_ is only tracked on the main thread since that's | 188 // The pending_dowork_count_ is only tracked on the main thread since that's |
| 188 // where re-entrant problems happen. | 189 // where re-entrant problems happen. |
| 189 int pending_dowork_count_; | 190 int pending_dowork_count_; |
| 190 | 191 |
| 191 int work_batch_size_; | 192 int work_batch_size_; |
| 192 | 193 |
| 193 scoped_refptr<cc::TestNowSource> time_source_; | 194 scoped_refptr<cc::TestNowSource> time_source_; |
| 194 | 195 |
| 195 ObserverList<base::MessageLoop::TaskObserver> task_observers_; | 196 ObserverList<base::MessageLoop::TaskObserver> task_observers_; |
| 196 | 197 |
| 198 const char* disabled_by_default_tracing_category_; | |
| 199 | |
| 197 base::WeakPtrFactory<TaskQueueManager> weak_factory_; | 200 base::WeakPtrFactory<TaskQueueManager> weak_factory_; |
| 198 | 201 |
| 199 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager); | 202 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager); |
| 200 }; | 203 }; |
| 201 | 204 |
| 202 } // namespace content | 205 } // namespace content |
| 203 | 206 |
| 204 #endif // CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_ | 207 #endif // CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_ |
| OLD | NEW |