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

Side by Side Diff: base/threading/platform_thread_internal_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, 8 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 unified diff | Download patch
« no previous file with comments | « base/threading/platform_thread_freebsd.cc ('k') | base/threading/platform_thread_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/threading/platform_thread_internal_posix.h" 5 #include "base/threading/platform_thread_internal_posix.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace base { 9 namespace base {
10 10
11 namespace internal { 11 namespace internal {
12 12
13 int ThreadPriorityToNiceValue(ThreadPriority priority) { 13 int ThreadPriorityToNiceValue(ThreadPriority priority) {
14 for (const ThreadPriorityToNiceValuePair& pair : 14 for (const ThreadPriorityToNiceValuePair& pair :
15 kThreadPriorityToNiceValueMap) { 15 kThreadPriorityToNiceValueMap) {
16 if (pair.priority == priority) 16 if (pair.priority == priority)
17 return pair.nice_value; 17 return pair.nice_value;
18 } 18 }
19 NOTREACHED() << "Unknown ThreadPriority"; 19 NOTREACHED() << "Unknown ThreadPriority";
20 return 0; 20 return 0;
21 } 21 }
22 22
23 ThreadPriority NiceValueToThreadPriority(int nice_value) { 23 ThreadPriority NiceValueToThreadPriority(int nice_value) {
24 for (const ThreadPriorityToNiceValuePair& pair : 24 for (const ThreadPriorityToNiceValuePair& pair :
25 kThreadPriorityToNiceValueMap) { 25 kThreadPriorityToNiceValueMap) {
26 if (pair.nice_value == nice_value) 26 if (pair.nice_value == nice_value)
27 return pair.priority; 27 return pair.priority;
28 } 28 }
29 NOTREACHED() << "Unknown nice value"; 29 NOTREACHED() << "Unknown nice value";
30 return kThreadPriority_Normal; 30 return ThreadPriority::NORMAL;
31 } 31 }
32 32
33 } // namespace internal 33 } // namespace internal
34 34
35 } // namespace base 35 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/platform_thread_freebsd.cc ('k') | base/threading/platform_thread_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698