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

Unified Diff: base/threading/platform_thread_posix.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_mac.mm ('k') | base/threading/platform_thread_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/platform_thread_posix.cc
diff --git a/base/threading/platform_thread_posix.cc b/base/threading/platform_thread_posix.cc
index 600c5ce999a98b6a159c922027ec9b3218bfb2e0..3dbdc9808752c2b1411aa516fcf5b8bf328fa88c 100644
--- a/base/threading/platform_thread_posix.cc
+++ b/base/threading/platform_thread_posix.cc
@@ -39,7 +39,7 @@ struct ThreadParams {
ThreadParams()
: delegate(NULL),
joinable(false),
- priority(kThreadPriority_Normal),
+ priority(ThreadPriority::NORMAL),
handle(NULL),
handle_set(false, false) {
}
@@ -59,7 +59,7 @@ void* ThreadFunc(void* params) {
if (!thread_params->joinable)
base::ThreadRestrictions::SetSingletonAllowed(false);
- if (thread_params->priority != kThreadPriority_Normal) {
+ if (thread_params->priority != ThreadPriority::NORMAL) {
PlatformThread::SetThreadPriority(PlatformThread::CurrentHandle(),
thread_params->priority);
}
@@ -201,7 +201,7 @@ bool PlatformThread::Create(size_t stack_size, Delegate* delegate,
PlatformThreadHandle* thread_handle) {
base::ThreadRestrictions::ScopedAllowWait allow_wait;
return CreateThread(stack_size, true /* joinable thread */,
- delegate, thread_handle, kThreadPriority_Normal);
+ delegate, thread_handle, ThreadPriority::NORMAL);
}
// static
@@ -219,7 +219,7 @@ bool PlatformThread::CreateNonJoinable(size_t stack_size, Delegate* delegate) {
base::ThreadRestrictions::ScopedAllowWait allow_wait;
bool result = CreateThread(stack_size, false /* non-joinable thread */,
- delegate, &unused, kThreadPriority_Normal);
+ delegate, &unused, ThreadPriority::NORMAL);
return result;
}
@@ -265,7 +265,7 @@ void PlatformThread::SetThreadPriority(PlatformThreadHandle handle,
ThreadPriority PlatformThread::GetThreadPriority(PlatformThreadHandle handle) {
#if defined(OS_NACL)
NOTIMPLEMENTED();
- return kThreadPriority_Normal;
+ return ThreadPriority::NORMAL;
#else
// Mirrors SetThreadPriority()'s implementation.
ThreadPriority platform_specific_priority;
@@ -283,7 +283,7 @@ ThreadPriority PlatformThread::GetThreadPriority(PlatformThreadHandle handle) {
getpriority(PRIO_PROCESS, handle.id_ == current_id ? 0 : handle.id_);
if (errno != 0) {
DVPLOG(1) << "Failed to get nice value of thread (" << handle.id_ << ")";
- return kThreadPriority_Normal;
+ return ThreadPriority::NORMAL;
}
return internal::NiceValueToThreadPriority(nice_value);
« no previous file with comments | « base/threading/platform_thread_mac.mm ('k') | base/threading/platform_thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698