Chromium Code Reviews| Index: content/renderer/raster_worker_pool.h |
| diff --git a/content/renderer/raster_worker_pool.h b/content/renderer/raster_worker_pool.h |
| index 1d6fc04ca6719ed8fd22f34093b7a35d3c8b4814..794141c9f744bb0e1ac12d97ce7dc12f67d03ddd 100644 |
| --- a/content/renderer/raster_worker_pool.h |
| +++ b/content/renderer/raster_worker_pool.h |
| @@ -48,7 +48,8 @@ class CONTENT_EXPORT RasterWorkerPool : public base::TaskRunner, |
| // Runs a task from one of the provided categories. Categories listed first |
| // have higher priority. |
| - void Run(const std::vector<cc::TaskCategory>& categories); |
| + void Run(const std::vector<cc::TaskCategory>& categories, |
| + base::ConditionVariable* work_ready_cv); |
|
reveman
2016/02/10 23:25:09
nit: s/work_ready_cv/has_ready_to_run_tasks_cv/
ericrk
2016/02/11 00:22:02
Done.
|
| void FlushForTesting(); |
| @@ -102,6 +103,14 @@ class CONTENT_EXPORT RasterWorkerPool : public base::TaskRunner, |
| DISALLOW_COPY_AND_ASSIGN(ClosureTask); |
| }; |
| + // Helper function which signals the CV for the next task to run. |
|
reveman
2016/02/10 23:25:09
nit: "...signals the worker threads if tasks are r
ericrk
2016/02/11 00:22:02
Done.
|
| + void SignalHasReadyToRunTasksWithLockAcquired(); |
| + |
| + // Determines if we should run a new task for the given category. This factors |
| + // in whether a task is available and whether the count of running tasks is |
| + // low enough to start a new one. |
| + bool ShouldRunTaskForCategoryWithLockAcquired(cc::TaskCategory category); |
|
reveman
2016/02/10 23:25:09
nit: move these functions so the order and locatio
ericrk
2016/02/11 00:22:02
Done.
|
| + |
| void ScheduleTasksWithLockAcquired(cc::NamespaceToken token, |
| cc::TaskGraph* graph); |
| void CollectCompletedTasksWithLockAcquired(cc::NamespaceToken token, |
| @@ -124,9 +133,9 @@ class CONTENT_EXPORT RasterWorkerPool : public base::TaskRunner, |
| // Cached vector to avoid allocation when getting the list of complete |
| // tasks. |
| cc::Task::Vector completed_tasks_; |
| - // Condition variable that is waited on by Run() until new tasks are ready to |
| - // run or shutdown starts. |
| - base::ConditionVariable has_ready_to_run_tasks_cv_; |
| + // Condition variables for foreground and background tasks. |
| + base::ConditionVariable foreground_has_ready_to_run_tasks_cv_; |
|
reveman
2016/02/10 23:25:09
nit: s/foreground_has_ready_to_run_tasks_cv_/has_r
ericrk
2016/02/11 00:22:02
Done.
|
| + base::ConditionVariable background_has_ready_to_run_tasks_cv_; |
|
reveman
2016/02/10 23:25:09
nit: s/background_has_ready_to_run_tasks_cv_/has_r
ericrk
2016/02/11 00:22:02
Done.
|
| // Condition variable that is waited on by origin threads until a namespace |
| // has finished running all associated tasks. |
| base::ConditionVariable has_namespaces_with_finished_running_tasks_cv_; |