Chromium Code Reviews| Index: base/threading/platform_thread_win.cc |
| diff --git a/base/threading/platform_thread_win.cc b/base/threading/platform_thread_win.cc |
| index c2eab6ccfd3e7462ec9816dee32ef54204c0f3f7..56611703736c2a1ef6d931bde248aa8cd8bff869 100644 |
| --- a/base/threading/platform_thread_win.cc |
| +++ b/base/threading/platform_thread_win.cc |
| @@ -56,8 +56,7 @@ DWORD __stdcall ThreadFunc(void* params) { |
| base::ThreadRestrictions::SetSingletonAllowed(false); |
| if (thread_params->priority != ThreadPriority::NORMAL) { |
| - PlatformThread::SetThreadPriority( |
| - PlatformThread::CurrentHandle(), thread_params->priority); |
| + PlatformThread::SetCurrentThreadPriority(thread_params->priority); |
| } |
|
gab
2015/06/26 15:57:13
nit: can remove {}
Takashi Toyoshima
2015/06/29 05:48:51
Done.
|
| // Retrieve a copy of the thread handle to use as the key in the |
| @@ -238,8 +237,7 @@ void PlatformThread::Join(PlatformThreadHandle thread_handle) { |
| } |
| // static |
| -void PlatformThread::SetThreadPriority(PlatformThreadHandle handle, |
| - ThreadPriority priority) { |
| +void PlatformThread::SetCurrentThreadPriority(ThreadPriority priority) { |
| DCHECK(!handle.is_null()); |
| int desired_priority = THREAD_PRIORITY_ERROR_RETURN; |
| @@ -265,16 +263,18 @@ void PlatformThread::SetThreadPriority(PlatformThreadHandle handle, |
| #ifndef NDEBUG |
| const BOOL success = |
| #endif |
| - ::SetThreadPriority(handle.platform_handle(), desired_priority); |
| + ::SetThreadPriority(PlatformThread::CurrentHandle().platform_handle(), |
| + desired_priority); |
| DPLOG_IF(ERROR, !success) << "Failed to set thread priority to " |
| << desired_priority; |
| } |
| // static |
| -ThreadPriority PlatformThread::GetThreadPriority(PlatformThreadHandle handle) { |
| +ThreadPriority PlatformThread::GetCurrentThreadPriority() { |
| DCHECK(!handle.is_null()); |
| - int priority = ::GetThreadPriority(handle.platform_handle()); |
| + int priority = |
| + ::GetThreadPriority(PlatformThread::CurrentHandle().platform_handle()); |
| switch (priority) { |
| case THREAD_PRIORITY_LOWEST: |
| return ThreadPriority::BACKGROUND; |