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

Side by Side Diff: content/renderer/gpu/compositor_output_surface.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
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 "content/renderer/gpu/compositor_output_surface.h" 5 #include "content/renderer/gpu/compositor_output_surface.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop/message_loop_proxy.h" 8 #include "base/message_loop/message_loop_proxy.h"
9 #include "cc/output/compositor_frame.h" 9 #include "cc/output/compositor_frame.h"
10 #include "cc/output/compositor_frame_ack.h" 10 #include "cc/output/compositor_frame_ack.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 ReclaimResources(&ack); 208 ReclaimResources(&ack);
209 } 209 }
210 210
211 bool CompositorOutputSurface::Send(IPC::Message* message) { 211 bool CompositorOutputSurface::Send(IPC::Message* message) {
212 return message_sender_->Send(message); 212 return message_sender_->Send(message);
213 } 213 }
214 214
215 namespace { 215 namespace {
216 #if defined(OS_ANDROID) 216 #if defined(OS_ANDROID)
217 void SetThreadPriorityToIdle(base::PlatformThreadHandle handle) { 217 void SetThreadPriorityToIdle(base::PlatformThreadHandle handle) {
218 base::PlatformThread::SetThreadPriority( 218 base::PlatformThread::SetThreadPriority(handle,
219 handle, base::kThreadPriority_Background); 219 base::ThreadPriority::BACKGROUND);
220 } 220 }
221 void SetThreadPriorityToDefault(base::PlatformThreadHandle handle) { 221 void SetThreadPriorityToDefault(base::PlatformThreadHandle handle) {
222 base::PlatformThread::SetThreadPriority( 222 base::PlatformThread::SetThreadPriority(handle,
223 handle, base::kThreadPriority_Normal); 223 base::ThreadPriority::NORMAL);
224 } 224 }
225 #else 225 #else
226 void SetThreadPriorityToIdle(base::PlatformThreadHandle handle) {} 226 void SetThreadPriorityToIdle(base::PlatformThreadHandle handle) {}
227 void SetThreadPriorityToDefault(base::PlatformThreadHandle handle) {} 227 void SetThreadPriorityToDefault(base::PlatformThreadHandle handle) {}
228 #endif 228 #endif
229 } 229 }
230 230
231 void CompositorOutputSurface::UpdateSmoothnessTakesPriority( 231 void CompositorOutputSurface::UpdateSmoothnessTakesPriority(
232 bool prefers_smoothness) { 232 bool prefers_smoothness) {
233 #ifndef NDEBUG 233 #ifndef NDEBUG
(...skipping 13 matching lines...) Expand all
247 // If this is the last surface to stop preferring smoothness, 247 // If this is the last surface to stop preferring smoothness,
248 // Reset the main thread's priority to the default. 248 // Reset the main thread's priority to the default.
249 if (prefers_smoothness_ == true && 249 if (prefers_smoothness_ == true &&
250 --g_prefer_smoothness_count == 0) { 250 --g_prefer_smoothness_count == 0) {
251 SetThreadPriorityToDefault(main_thread_handle_); 251 SetThreadPriorityToDefault(main_thread_handle_);
252 } 252 }
253 prefers_smoothness_ = prefers_smoothness; 253 prefers_smoothness_ = prefers_smoothness;
254 } 254 }
255 255
256 } // namespace content 256 } // namespace content
OLDNEW
« no previous file with comments | « content/gpu/gpu_child_thread.cc ('k') | content/renderer/media/webrtc_local_audio_track_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698