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

Unified Diff: base/threading/platform_thread_android.cc

Issue 1214503002: Increase priority of raster threads on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Just change existing value to 9 Created 5 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/platform_thread_android.cc
diff --git a/base/threading/platform_thread_android.cc b/base/threading/platform_thread_android.cc
index 11e5e2e3c870d25d79d205e7dcd349239a02eac2..e661af5eab0c96d7d73f72e670e90ef15d8f4663 100644
--- a/base/threading/platform_thread_android.cc
+++ b/base/threading/platform_thread_android.cc
@@ -23,22 +23,15 @@ namespace base {
namespace internal {
-// These nice values are taken from Android, which uses nice values like linux,
-// but defines some preset nice values.
-// Process.THREAD_PRIORITY_AUDIO = -16
-// Process.THREAD_PRIORITY_BACKGROUND = 10
-// Process.THREAD_PRIORITY_DEFAULT = 0;
-// Process.THREAD_PRIORITY_DISPLAY = -4;
-// Process.THREAD_PRIORITY_FOREGROUND = -2;
-// Process.THREAD_PRIORITY_LESS_FAVORABLE = 1;
-// Process.THREAD_PRIORITY_LOWEST = 19;
-// Process.THREAD_PRIORITY_MORE_FAVORABLE = -1;
-// Process.THREAD_PRIORITY_URGENT_AUDIO = -19;
-// Process.THREAD_PRIORITY_URGENT_DISPLAY = -8;
-// We use -6 for display, but we may want to split this into urgent (-8) and
-// non-urgent (-4).
+// - BACKGROUND is 9 due to it being the nicest value we can use that's still
danakj 2015/07/06 23:24:22 Thanks this comment is awesome.
+// above an Android system threshold that enables heavy throttling starting at
+// 10; we want to be lower-priority than Chrome's other threads without
+// incurring this behavior.
+// - DISPLAY is -6 due to being midway between Android's DISPLAY (-4) and
+// URGENT_DISPLAY (-8).
+// - REALTIME_AUDIO corresponds to Android's THREAD_PRIORITY_AUDIO = -16 value.
const ThreadPriorityToNiceValuePair kThreadPriorityToNiceValueMap[4] = {
- {ThreadPriority::BACKGROUND, 10},
+ {ThreadPriority::BACKGROUND, 9},
{ThreadPriority::NORMAL, 0},
{ThreadPriority::DISPLAY, -6},
{ThreadPriority::REALTIME_AUDIO, -16},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698