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

Unified Diff: content/renderer/raster_worker_pool.cc

Issue 1616953003: content: Improve thread priority for raster threads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no ThreadPriority::BACKGROUND on mac Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/raster_worker_pool.cc
diff --git a/content/renderer/raster_worker_pool.cc b/content/renderer/raster_worker_pool.cc
index 73ec4ef60210dddf63bce35c1680311806c40070..e8ed13bf8cad0012e91abc13f9b2d6d3b23b117a 100644
--- a/content/renderer/raster_worker_pool.cc
+++ b/content/renderer/raster_worker_pool.cc
@@ -124,9 +124,7 @@ RasterWorkerPool::RasterWorkerPool()
has_namespaces_with_finished_running_tasks_cv_(&lock_),
shutdown_(false) {}
-void RasterWorkerPool::Start(
- int num_threads,
- const base::SimpleThread::Options& thread_options) {
+void RasterWorkerPool::Start(int num_threads) {
DCHECK(threads_.empty());
// Start |num_threads| threads for foreground work, including nonconcurrent
@@ -140,7 +138,7 @@ void RasterWorkerPool::Start(
base::StringPrintf("CompositorTileWorker%u",
static_cast<unsigned>(threads_.size() + 1))
.c_str(),
- thread_options, this, foreground_categories,
+ base::SimpleThread::Options(), this, foreground_categories,
&has_ready_to_run_foreground_tasks_cv_));
thread->Start();
threads_.push_back(std::move(thread));
@@ -149,6 +147,13 @@ void RasterWorkerPool::Start(
// Start a single thread for background work.
std::vector<cc::TaskCategory> background_categories;
background_categories.push_back(cc::TASK_CATEGORY_BACKGROUND);
+
+ // Use background priority for background thread.
+ base::SimpleThread::Options thread_options;
+#if !defined(OS_MACOSX)
+ thread_options.set_priority(base::ThreadPriority::BACKGROUND);
+#endif
+
scoped_ptr<base::SimpleThread> thread(new RasterWorkerPoolThread(
base::StringPrintf("CompositorTileWorker%u",
static_cast<unsigned>(threads_.size() + 1))

Powered by Google App Engine
This is Rietveld 408576698