| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 // Runs a task from one of the provided categories. Categories listed first | 49 // Runs a task from one of the provided categories. Categories listed first |
| 50 // have higher priority. | 50 // have higher priority. |
| 51 void Run(const std::vector<cc::TaskCategory>& categories, | 51 void Run(const std::vector<cc::TaskCategory>& categories, |
| 52 base::ConditionVariable* has_ready_to_run_tasks_cv); | 52 base::ConditionVariable* has_ready_to_run_tasks_cv); |
| 53 | 53 |
| 54 void FlushForTesting(); | 54 void FlushForTesting(); |
| 55 | 55 |
| 56 // Spawn |num_threads| number of threads and start running work on the | 56 // Spawn |num_threads| number of threads and start running work on the |
| 57 // worker threads. | 57 // worker threads. |
| 58 void Start(int num_threads, | 58 void Start(int num_threads); |
| 59 const base::SimpleThread::Options& thread_options); | |
| 60 | 59 |
| 61 // Finish running all the posted tasks (and nested task posted by those tasks) | 60 // Finish running all the posted tasks (and nested task posted by those tasks) |
| 62 // of all the associated task runners. | 61 // of all the associated task runners. |
| 63 // Once all the tasks are executed the method blocks until the threads are | 62 // Once all the tasks are executed the method blocks until the threads are |
| 64 // terminated. | 63 // terminated. |
| 65 void Shutdown(); | 64 void Shutdown(); |
| 66 | 65 |
| 67 cc::TaskGraphRunner* GetTaskGraphRunner() { return this; } | 66 cc::TaskGraphRunner* GetTaskGraphRunner() { return this; } |
| 68 | 67 |
| 69 // Create a new sequenced task graph runner. | 68 // Create a new sequenced task graph runner. |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // Condition variable that is waited on by origin threads until a namespace | 138 // Condition variable that is waited on by origin threads until a namespace |
| 140 // has finished running all associated tasks. | 139 // has finished running all associated tasks. |
| 141 base::ConditionVariable has_namespaces_with_finished_running_tasks_cv_; | 140 base::ConditionVariable has_namespaces_with_finished_running_tasks_cv_; |
| 142 // Set during shutdown. Tells Run() to return when no more tasks are pending. | 141 // Set during shutdown. Tells Run() to return when no more tasks are pending. |
| 143 bool shutdown_; | 142 bool shutdown_; |
| 144 }; | 143 }; |
| 145 | 144 |
| 146 } // namespace content | 145 } // namespace content |
| 147 | 146 |
| 148 #endif // CONTENT_RENDERER_RASTER_WORKER_POOL_H_ | 147 #endif // CONTENT_RENDERER_RASTER_WORKER_POOL_H_ |
| OLD | NEW |