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

Unified Diff: base/threading/platform_thread_android.cc

Issue 1051863003: Turn ThreadPriority enum into an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setthreadpri
Patch Set: nits Created 5 years, 9 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 | « base/threading/platform_thread.h ('k') | base/threading/platform_thread_freebsd.cc » ('j') | 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 be4ccbe976d0ace3e9fa8a150a4fb9965701e1e5..a31f65918fe621849d980dadd75ba8c63237fd15 100644
--- a/base/threading/platform_thread_android.cc
+++ b/base/threading/platform_thread_android.cc
@@ -38,17 +38,17 @@ namespace internal {
// We use -6 for display, but we may want to split this into urgent (-8) and
// non-urgent (-4).
const ThreadPriorityToNiceValuePair kThreadPriorityToNiceValueMap[4] = {
- {kThreadPriority_RealtimeAudio, -16},
- {kThreadPriority_Background, 10},
- {kThreadPriority_Normal, 0},
- {kThreadPriority_Display, -6},
+ {ThreadPriority::BACKGROUND, 10},
+ {ThreadPriority::NORMAL, 0},
+ {ThreadPriority::DISPLAY, -6},
+ {ThreadPriority::REALTIME_AUDIO, -16},
};
bool SetThreadPriorityForPlatform(PlatformThreadHandle handle,
ThreadPriority priority) {
// On Android, we set the Audio priority through JNI as Audio priority
// will also allow the process to run while it is backgrounded.
- if (priority == kThreadPriority_RealtimeAudio) {
+ if (priority == ThreadPriority::REALTIME_AUDIO) {
JNIEnv* env = base::android::AttachCurrentThread();
Java_ThreadUtils_setThreadPriorityAudio(env, PlatformThread::CurrentId());
return true;
@@ -89,7 +89,7 @@ void InitOnThread() {
// Threads on linux/android may inherit their priority from the thread
// where they were created. This sets all new threads to the default.
PlatformThread::SetThreadPriority(PlatformThread::CurrentHandle(),
- kThreadPriority_Normal);
+ ThreadPriority::NORMAL);
}
void TerminateOnThread() {
« no previous file with comments | « base/threading/platform_thread.h ('k') | base/threading/platform_thread_freebsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698