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

Side by Side Diff: content/gpu/gpu_child_thread.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: #21, git cl format, fix win build Created 5 years, 5 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/gpu/gpu_child_thread.h" 5 #include "content/gpu/gpu_child_thread.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/threading/worker_pool.h" 9 #include "base/threading/worker_pool.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 deferred_messages_.pop(); 210 deferred_messages_.pop();
211 } 211 }
212 212
213 if (dead_on_arrival_) { 213 if (dead_on_arrival_) {
214 LOG(ERROR) << "Exiting GPU process due to errors during initialization"; 214 LOG(ERROR) << "Exiting GPU process due to errors during initialization";
215 base::MessageLoop::current()->Quit(); 215 base::MessageLoop::current()->Quit();
216 return; 216 return;
217 } 217 }
218 218
219 #if defined(OS_ANDROID) 219 #if defined(OS_ANDROID)
220 base::PlatformThread::SetThreadPriority(base::PlatformThread::CurrentHandle(), 220 base::PlatformThread::SetCurrentThreadPriority(base::ThreadPriority::DISPLAY);
221 base::ThreadPriority::DISPLAY);
222 #endif 221 #endif
223 222
224 // We don't need to pipe log messages if we are running the GPU thread in 223 // We don't need to pipe log messages if we are running the GPU thread in
225 // the browser process. 224 // the browser process.
226 if (!in_browser_process_) 225 if (!in_browser_process_)
227 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); 226 logging::SetLogMessageHandler(GpuProcessLogMessageHandler);
228 227
229 // Defer creation of the render thread. This is to prevent it from handling 228 // Defer creation of the render thread. This is to prevent it from handling
230 // IPC messages before the sandbox has been enabled and all other necessary 229 // IPC messages before the sandbox has been enabled and all other necessary
231 // initialization has succeeded. 230 // initialization has succeeded.
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 } 334 }
336 335
337 void GpuChildThread::OnGpuSwitched() { 336 void GpuChildThread::OnGpuSwitched() {
338 DVLOG(1) << "GPU: GPU has switched"; 337 DVLOG(1) << "GPU: GPU has switched";
339 // Notify observers in the GPU process. 338 // Notify observers in the GPU process.
340 ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched(); 339 ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched();
341 } 340 }
342 341
343 } // namespace content 342 } // namespace content
344 343
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698