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

Unified Diff: base/threading/platform_thread_freebsd.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_android.cc ('k') | base/threading/platform_thread_internal_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/platform_thread_freebsd.cc
diff --git a/base/threading/platform_thread_freebsd.cc b/base/threading/platform_thread_freebsd.cc
index dc5d34b2c51168f3c0d639920074e61689e79a33..7ba4eedccbaf540168e0fe45875b991718e06e49 100644
--- a/base/threading/platform_thread_freebsd.cc
+++ b/base/threading/platform_thread_freebsd.cc
@@ -30,10 +30,10 @@ const struct sched_param kRealTimePrio = {8};
} // namespace
const ThreadPriorityToNiceValuePair kThreadPriorityToNiceValueMap[4] = {
- { kThreadPriority_RealtimeAudio, -10 },
- { kThreadPriority_Background, 10 },
- { kThreadPriority_Normal, 0 },
- { kThreadPriority_Display, -6 },
+ {ThreadPriority::BACKGROUND, 10},
+ {ThreadPriority::NORMAL, 0},
+ {ThreadPriority::DISPLAY, -6},
+ {ThreadPriority::REALTIME_AUDIO, -10},
}
bool SetThreadPriorityForPlatform(PlatformThreadHandle handle,
@@ -41,7 +41,7 @@ bool SetThreadPriorityForPlatform(PlatformThreadHandle handle,
#if !defined(OS_NACL)
// TODO(gab): Assess the correctness of using |pthread_self()| below instead
// of |handle|. http://crbug.com/468793.
- return priority == kThreadPriority_RealtimeAudio &&
+ return priority == ThreadPriority::REALTIME_AUDIO &&
pthread_setschedparam(pthread_self(), SCHED_RR, &kRealTimePrio) == 0;
#else
return false;
@@ -59,7 +59,7 @@ bool GetThreadPriorityForPlatform(PlatformThreadHandle handle,
&maybe_realtime_prio) == 0 &&
maybe_sched_rr == SCHED_RR &&
maybe_realtime_prio.sched_priority == kRealTimePrio.sched_priority) {
- *priority = kThreadPriority_RealtimeAudio;
+ *priority = ThreadPriority::REALTIME_AUDIO;
return true;
}
#endif
« no previous file with comments | « base/threading/platform_thread_android.cc ('k') | base/threading/platform_thread_internal_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698