Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(552)

Side by Side Diff: content/renderer/raster_worker_pool.cc

Issue 1739993004: content: Implement dynamic priorities for raster threads. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Traces corrected. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/raster/task_graph_work_queue.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 "CompositorTileWorkerBackground", thread_options, this,
159 static_cast<unsigned>(threads_.size() + 1)) 159 background_categories, &has_ready_to_run_background_tasks_cv_));
160 .c_str(),
161 thread_options, this, background_categories,
162 &has_ready_to_run_background_tasks_cv_));
163 thread->Start(); 160 thread->Start();
164 threads_.push_back(std::move(thread)); 161 threads_.push_back(std::move(thread));
165 } 162 }
166 163
167 void RasterWorkerPool::Shutdown() { 164 void RasterWorkerPool::Shutdown() {
168 WaitForTasksToFinishRunning(namespace_token_); 165 WaitForTasksToFinishRunning(namespace_token_);
169 CollectCompletedTasks(namespace_token_, &completed_tasks_); 166 CollectCompletedTasks(namespace_token_, &completed_tasks_);
170 // Shutdown raster threads. 167 // Shutdown raster threads.
171 { 168 {
172 base::AutoLock lock(lock_); 169 base::AutoLock lock(lock_);
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 424
428 // Overridden from cc::Task: 425 // Overridden from cc::Task:
429 void RasterWorkerPool::ClosureTask::RunOnWorkerThread() { 426 void RasterWorkerPool::ClosureTask::RunOnWorkerThread() {
430 closure_.Run(); 427 closure_.Run();
431 closure_.Reset(); 428 closure_.Reset();
432 } 429 }
433 430
434 RasterWorkerPool::ClosureTask::~ClosureTask() {} 431 RasterWorkerPool::ClosureTask::~ClosureTask() {}
435 432
436 } // namespace content 433 } // namespace content
OLDNEW
« no previous file with comments | « cc/raster/task_graph_work_queue.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698