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

Unified Diff: base/threading/platform_thread_android.cc

Issue 1193303002: base/threading: restrict to set only current thread priority (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: two more android fix and review #2 Created 5 years, 6 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_android.cc
diff --git a/base/threading/platform_thread_android.cc b/base/threading/platform_thread_android.cc
index 11e5e2e3c870d25d79d205e7dcd349239a02eac2..e5232118ba3a76c8917d9f79a64b8d5b47a606ec 100644
--- a/base/threading/platform_thread_android.cc
+++ b/base/threading/platform_thread_android.cc
@@ -44,8 +44,7 @@ const ThreadPriorityToNiceValuePair kThreadPriorityToNiceValueMap[4] = {
{ThreadPriority::REALTIME_AUDIO, -16},
};
-bool SetThreadPriorityForPlatform(PlatformThreadHandle handle,
- ThreadPriority priority) {
+bool SetCurrentThreadPriorityForPlatform(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 == ThreadPriority::REALTIME_AUDIO) {
@@ -56,8 +55,7 @@ bool SetThreadPriorityForPlatform(PlatformThreadHandle handle,
return false;
}
-bool GetThreadPriorityForPlatform(PlatformThreadHandle handle,
- ThreadPriority* priority) {
+bool GetCurrentThreadPriorityForPlatform(ThreadPriority* priority) {
NOTIMPLEMENTED();
return false;
}
@@ -88,8 +86,7 @@ void InitThreading() {
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(),
- ThreadPriority::NORMAL);
+ PlatformThread::SetCurrentThreadPriority(ThreadPriority::NORMAL);
}
void TerminateOnThread() {

Powered by Google App Engine
This is Rietveld 408576698