OLD | NEW |
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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 deferred_messages_.pop(); | 223 deferred_messages_.pop(); |
224 } | 224 } |
225 | 225 |
226 if (dead_on_arrival_) { | 226 if (dead_on_arrival_) { |
227 LOG(ERROR) << "Exiting GPU process due to errors during initialization"; | 227 LOG(ERROR) << "Exiting GPU process due to errors during initialization"; |
228 base::MessageLoop::current()->Quit(); | 228 base::MessageLoop::current()->Quit(); |
229 return; | 229 return; |
230 } | 230 } |
231 | 231 |
232 #if defined(OS_ANDROID) | 232 #if defined(OS_ANDROID) |
233 base::PlatformThread::SetThreadPriority(base::PlatformThread::CurrentHandle(), | 233 base::PlatformThread::SetCurrentThreadPriority(base::ThreadPriority::DISPLAY); |
234 base::ThreadPriority::DISPLAY); | |
235 #endif | 234 #endif |
236 | 235 |
237 // We don't need to pipe log messages if we are running the GPU thread in | 236 // We don't need to pipe log messages if we are running the GPU thread in |
238 // the browser process. | 237 // the browser process. |
239 if (!in_browser_process_) | 238 if (!in_browser_process_) |
240 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); | 239 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); |
241 | 240 |
242 // Defer creation of the render thread. This is to prevent it from handling | 241 // Defer creation of the render thread. This is to prevent it from handling |
243 // IPC messages before the sandbox has been enabled and all other necessary | 242 // IPC messages before the sandbox has been enabled and all other necessary |
244 // initialization has succeeded. | 243 // initialization has succeeded. |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 } | 347 } |
349 | 348 |
350 void GpuChildThread::OnGpuSwitched() { | 349 void GpuChildThread::OnGpuSwitched() { |
351 DVLOG(1) << "GPU: GPU has switched"; | 350 DVLOG(1) << "GPU: GPU has switched"; |
352 // Notify observers in the GPU process. | 351 // Notify observers in the GPU process. |
353 ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched(); | 352 ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched(); |
354 } | 353 } |
355 | 354 |
356 } // namespace content | 355 } // namespace content |
357 | 356 |
OLD | NEW |