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

Side by Side Diff: base/threading/platform_thread_win.cc

Issue 1214503002: Increase priority of raster threads on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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.h" 5 #include "base/threading/platform_thread.h"
6 6
7 #include "base/debug/alias.h" 7 #include "base/debug/alias.h"
8 #include "base/debug/profiler.h" 8 #include "base/debug/profiler.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/threading/thread_id_name_manager.h" 10 #include "base/threading/thread_id_name_manager.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // static 233 // static
234 void PlatformThread::SetThreadPriority(PlatformThreadHandle handle, 234 void PlatformThread::SetThreadPriority(PlatformThreadHandle handle,
235 ThreadPriority priority) { 235 ThreadPriority priority) {
236 DCHECK(!handle.is_null()); 236 DCHECK(!handle.is_null());
237 237
238 int desired_priority = THREAD_PRIORITY_ERROR_RETURN; 238 int desired_priority = THREAD_PRIORITY_ERROR_RETURN;
239 switch (priority) { 239 switch (priority) {
240 case ThreadPriority::BACKGROUND: 240 case ThreadPriority::BACKGROUND:
241 desired_priority = THREAD_PRIORITY_LOWEST; 241 desired_priority = THREAD_PRIORITY_LOWEST;
242 break; 242 break;
243 case ThreadPriority::UI_BACKGROUND:
no sievers 2015/06/25 22:52:15 Now I'm wondering if BELOW_NORMAL is actually a be
aelias_OOO_until_Jul13 2015/06/25 23:49:13 I chose UI_BACKGROUND because the other priority n
244 desired_priority = THREAD_PRIORITY_BELOW_NORMAL;
245 break;
243 case ThreadPriority::NORMAL: 246 case ThreadPriority::NORMAL:
244 desired_priority = THREAD_PRIORITY_NORMAL; 247 desired_priority = THREAD_PRIORITY_NORMAL;
245 break; 248 break;
246 case ThreadPriority::DISPLAY: 249 case ThreadPriority::DISPLAY:
247 desired_priority = THREAD_PRIORITY_ABOVE_NORMAL; 250 desired_priority = THREAD_PRIORITY_ABOVE_NORMAL;
248 break; 251 break;
249 case ThreadPriority::REALTIME_AUDIO: 252 case ThreadPriority::REALTIME_AUDIO:
250 desired_priority = THREAD_PRIORITY_TIME_CRITICAL; 253 desired_priority = THREAD_PRIORITY_TIME_CRITICAL;
251 break; 254 break;
252 default: 255 default:
(...skipping 26 matching lines...) Expand all
279 return ThreadPriority::REALTIME_AUDIO; 282 return ThreadPriority::REALTIME_AUDIO;
280 case THREAD_PRIORITY_ERROR_RETURN: 283 case THREAD_PRIORITY_ERROR_RETURN:
281 DPCHECK(false) << "GetThreadPriority error"; // Falls through. 284 DPCHECK(false) << "GetThreadPriority error"; // Falls through.
282 default: 285 default:
283 NOTREACHED() << "Unexpected priority: " << priority; 286 NOTREACHED() << "Unexpected priority: " << priority;
284 return ThreadPriority::NORMAL; 287 return ThreadPriority::NORMAL;
285 } 288 }
286 } 289 }
287 290
288 } // namespace base 291 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698