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 CONTENT_RENDERER_RASTER_WORKER_POOL_H_ | 5 #ifndef CONTENT_RENDERER_RASTER_WORKER_POOL_H_ |
6 #define CONTENT_RENDERER_RASTER_WORKER_POOL_H_ | 6 #define CONTENT_RENDERER_RASTER_WORKER_POOL_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 protected: | 88 protected: |
89 ~ClosureTask() override; | 89 ~ClosureTask() override; |
90 | 90 |
91 private: | 91 private: |
92 base::Closure closure_; | 92 base::Closure closure_; |
93 | 93 |
94 DISALLOW_COPY_AND_ASSIGN(ClosureTask); | 94 DISALLOW_COPY_AND_ASSIGN(ClosureTask); |
95 }; | 95 }; |
96 | 96 |
| 97 void CreateAndStartRasterWorkerPoolThread( |
| 98 const base::SimpleThread::Options& thread_options, |
| 99 const std::vector<cc::TaskCategory>& categories, |
| 100 base::ConditionVariable* has_ready_to_run_tasks_cv); |
| 101 |
97 void ScheduleTasksWithLockAcquired(cc::NamespaceToken token, | 102 void ScheduleTasksWithLockAcquired(cc::NamespaceToken token, |
98 cc::TaskGraph* graph); | 103 cc::TaskGraph* graph); |
99 void CollectCompletedTasksWithLockAcquired(cc::NamespaceToken token, | 104 void CollectCompletedTasksWithLockAcquired(cc::NamespaceToken token, |
100 cc::Task::Vector* completed_tasks); | 105 cc::Task::Vector* completed_tasks); |
101 | 106 |
102 // Runs a task from one of the provided categories. Categories listed first | 107 // Runs a task from one of the provided categories. Categories listed first |
103 // have higher priority. Returns false if there were no tasks to run. | 108 // have higher priority. Returns false if there were no tasks to run. |
104 bool RunTaskWithLockAcquired(const std::vector<cc::TaskCategory>& categories); | 109 bool RunTaskWithLockAcquired(const std::vector<cc::TaskCategory>& categories); |
105 | 110 |
106 // Run next task for the given category. Caller must acquire |lock_| prior to | 111 // Run next task for the given category. Caller must acquire |lock_| prior to |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // Condition variable that is waited on by origin threads until a namespace | 143 // Condition variable that is waited on by origin threads until a namespace |
139 // has finished running all associated tasks. | 144 // has finished running all associated tasks. |
140 base::ConditionVariable has_namespaces_with_finished_running_tasks_cv_; | 145 base::ConditionVariable has_namespaces_with_finished_running_tasks_cv_; |
141 // Set during shutdown. Tells Run() to return when no more tasks are pending. | 146 // Set during shutdown. Tells Run() to return when no more tasks are pending. |
142 bool shutdown_; | 147 bool shutdown_; |
143 }; | 148 }; |
144 | 149 |
145 } // namespace content | 150 } // namespace content |
146 | 151 |
147 #endif // CONTENT_RENDERER_RASTER_WORKER_POOL_H_ | 152 #endif // CONTENT_RENDERER_RASTER_WORKER_POOL_H_ |
OLD | NEW |