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

Unified Diff: base/threading/platform_thread_internal_posix.cc

Issue 1015503002: Deduplicate PlatformThread's POSIX implementations of SetThreadPriority. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@background_threads
Patch Set: more fixes 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
Index: base/threading/platform_thread_internal_posix.cc
diff --git a/base/threading/platform_thread_internal_posix.cc b/base/threading/platform_thread_internal_posix.cc
new file mode 100644
index 0000000000000000000000000000000000000000..85160cb23717f44b1a05721466692295edc88c43
--- /dev/null
+++ b/base/threading/platform_thread_internal_posix.cc
@@ -0,0 +1,25 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/threading/platform_thread_internal_posix.h"
+
+#include "base/logging.h"
+
+namespace base {
+
+namespace internal {
+
+int ThreadPriorityToNiceValue(ThreadPriority priority) {
+ for (const ThreadPriorityToNiceValuePair& tnp :
rvargas (doing something else) 2015/03/17 22:15:21 nit: don't abbreviate tnp
gab 2015/03/18 19:01:05 how about "pair"? Or do you prefer something verbo
rvargas (doing something else) 2015/03/18 22:54:23 "pair" is fine
+ kThreadPriorityToNiceValueMap) {
+ if (tnp.priority == priority)
+ return tnp.nice_value;
+ }
+ NOTREACHED() << "Unknown ThreadPriority";
+ return 0;
+}
+
+} // namespace internal
+
+} // namespace base

Powered by Google App Engine
This is Rietveld 408576698