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

Unified Diff: cc/raster_worker_pool.cc

Issue 11880014: cc: Set ui/gpu/cc/ipc/upload/raster thread priorities. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address feedback (use static). Created 7 years, 11 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
« no previous file with comments | « cc/raster_worker_pool.h ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/raster_worker_pool.cc
diff --git a/cc/raster_worker_pool.cc b/cc/raster_worker_pool.cc
index 11fa5777b8d0c3e6639ad2c23d7522010c887c7f..cc10956af08b8654de5410b075d44a1a3cfbbd58 100644
--- a/cc/raster_worker_pool.cc
+++ b/cc/raster_worker_pool.cc
@@ -13,6 +13,11 @@
#include "cc/picture_pile_impl.h"
#include "third_party/skia/include/core/SkDevice.h"
+#if defined(OS_ANDROID)
+// TODO(epenner): Move thread priorities to base. (crbug.com/170549)
+#include <sys/resource.h>
+#endif
+
namespace cc {
namespace {
@@ -77,6 +82,14 @@ RasterWorkerPool::Thread::~Thread() {
Stop();
}
+void RasterWorkerPool::Thread::Init() {
+#if defined(OS_ANDROID)
+ // TODO(epenner): Move thread priorities to base. (crbug.com/170549)
+ int nice_value = 10; // Idle priority.
+ setpriority(PRIO_PROCESS, base::PlatformThread::CurrentId(), nice_value);
+#endif
+}
+
RasterWorkerPool::RasterWorkerPool(size_t num_raster_threads) {
const std::string thread_name_prefix = kRasterThreadNamePrefix;
while (raster_threads_.size() < num_raster_threads) {
« no previous file with comments | « cc/raster_worker_pool.h ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698