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 #include "content/renderer/raster_worker_pool.h" | 5 #include "content/renderer/raster_worker_pool.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 std::vector<cc::TaskCategory> background_categories; | 148 std::vector<cc::TaskCategory> background_categories; |
149 background_categories.push_back(cc::TASK_CATEGORY_BACKGROUND); | 149 background_categories.push_back(cc::TASK_CATEGORY_BACKGROUND); |
150 | 150 |
151 // Use background priority for background thread. | 151 // Use background priority for background thread. |
152 base::SimpleThread::Options thread_options; | 152 base::SimpleThread::Options thread_options; |
153 #if !defined(OS_MACOSX) | 153 #if !defined(OS_MACOSX) |
154 thread_options.set_priority(base::ThreadPriority::BACKGROUND); | 154 thread_options.set_priority(base::ThreadPriority::BACKGROUND); |
155 #endif | 155 #endif |
156 | 156 |
157 scoped_ptr<base::SimpleThread> thread(new RasterWorkerPoolThread( | 157 scoped_ptr<base::SimpleThread> thread(new RasterWorkerPoolThread( |
158 base::StringPrintf("CompositorTileWorker%u", | 158 base::StringPrintf("CompositorBackgroundTileWorker%u", |
reveman
2016/03/25 06:30:02
Maybe replace the "%u" with "Background" instead a
| |
159 static_cast<unsigned>(threads_.size() + 1)) | 159 static_cast<unsigned>(threads_.size() + 1)) |
160 .c_str(), | 160 .c_str(), |
161 thread_options, this, background_categories, | 161 thread_options, this, background_categories, |
162 &has_ready_to_run_background_tasks_cv_)); | 162 &has_ready_to_run_background_tasks_cv_)); |
163 thread->Start(); | 163 thread->Start(); |
164 threads_.push_back(std::move(thread)); | 164 threads_.push_back(std::move(thread)); |
165 } | 165 } |
166 | 166 |
167 void RasterWorkerPool::Shutdown() { | 167 void RasterWorkerPool::Shutdown() { |
168 WaitForTasksToFinishRunning(namespace_token_); | 168 WaitForTasksToFinishRunning(namespace_token_); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
427 | 427 |
428 // Overridden from cc::Task: | 428 // Overridden from cc::Task: |
429 void RasterWorkerPool::ClosureTask::RunOnWorkerThread() { | 429 void RasterWorkerPool::ClosureTask::RunOnWorkerThread() { |
430 closure_.Run(); | 430 closure_.Run(); |
431 closure_.Reset(); | 431 closure_.Reset(); |
432 } | 432 } |
433 | 433 |
434 RasterWorkerPool::ClosureTask::~ClosureTask() {} | 434 RasterWorkerPool::ClosureTask::~ClosureTask() {} |
435 | 435 |
436 } // namespace content | 436 } // namespace content |
OLD | NEW |