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

Unified Diff: cc/resources/tile_task_worker_pool.cc

Issue 822713002: Update from https://crrev.com/309415 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years 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: cc/resources/tile_task_worker_pool.cc
diff --git a/cc/resources/tile_task_worker_pool.cc b/cc/resources/tile_task_worker_pool.cc
index 1c0d6b980edfb273cbaa0bb28d0e87edd8edf309..e1eaa57bbc36aa09b03e95393d45a1c38dd48bed 100644
--- a/cc/resources/tile_task_worker_pool.cc
+++ b/cc/resources/tile_task_worker_pool.cc
@@ -19,6 +19,8 @@
namespace cc {
namespace {
+base::ThreadPriority g_worker_thread_priority = base::kThreadPriority_Normal;
+
class TileTaskGraphRunner : public TaskGraphRunner,
public base::DelegateSimpleThread::Delegate {
public:
@@ -31,9 +33,7 @@ class TileTaskGraphRunner : public TaskGraphRunner,
"CompositorTileWorker%u",
static_cast<unsigned>(workers_.size() + 1)).c_str()));
worker->Start();
-#if defined(OS_ANDROID) || defined(OS_LINUX)
- worker->SetThreadPriority(base::kThreadPriority_Background);
-#endif
+ worker->SetThreadPriority(g_worker_thread_priority);
workers_.push_back(worker.Pass());
}
}
@@ -120,6 +120,12 @@ int TileTaskWorkerPool::GetNumWorkerThreads() {
}
// static
+void TileTaskWorkerPool::SetWorkerThreadPriority(
+ base::ThreadPriority priority) {
+ g_worker_thread_priority = priority;
+}
+
+// static
TaskGraphRunner* TileTaskWorkerPool::GetTaskGraphRunner() {
return g_task_graph_runner.Pointer();
}

Powered by Google App Engine
This is Rietveld 408576698