Chromium Code Reviews| 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}, |