| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 deferred_messages_.pop(); | 160 deferred_messages_.pop(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 if (dead_on_arrival_) { | 163 if (dead_on_arrival_) { |
| 164 LOG(ERROR) << "Exiting GPU process due to errors during initialization"; | 164 LOG(ERROR) << "Exiting GPU process due to errors during initialization"; |
| 165 base::MessageLoop::current()->Quit(); | 165 base::MessageLoop::current()->Quit(); |
| 166 return; | 166 return; |
| 167 } | 167 } |
| 168 | 168 |
| 169 #if defined(OS_ANDROID) | 169 #if defined(OS_ANDROID) |
| 170 base::PlatformThread::SetThreadPriority( | 170 base::PlatformThread::SetThreadPriority(base::PlatformThread::CurrentHandle(), |
| 171 base::PlatformThread::CurrentHandle(), | 171 base::ThreadPriority::DISPLAY); |
| 172 base::kThreadPriority_Display); | |
| 173 #endif | 172 #endif |
| 174 | 173 |
| 175 // We don't need to pipe log messages if we are running the GPU thread in | 174 // We don't need to pipe log messages if we are running the GPU thread in |
| 176 // the browser process. | 175 // the browser process. |
| 177 if (!in_browser_process_) | 176 if (!in_browser_process_) |
| 178 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); | 177 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); |
| 179 | 178 |
| 180 // Defer creation of the render thread. This is to prevent it from handling | 179 // Defer creation of the render thread. This is to prevent it from handling |
| 181 // IPC messages before the sandbox has been enabled and all other necessary | 180 // IPC messages before the sandbox has been enabled and all other necessary |
| 182 // initialization has succeeded. | 181 // initialization has succeeded. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 } | 286 } |
| 288 | 287 |
| 289 void GpuChildThread::OnGpuSwitched() { | 288 void GpuChildThread::OnGpuSwitched() { |
| 290 DVLOG(1) << "GPU: GPU has switched"; | 289 DVLOG(1) << "GPU: GPU has switched"; |
| 291 // Notify observers in the GPU process. | 290 // Notify observers in the GPU process. |
| 292 ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched(); | 291 ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched(); |
| 293 } | 292 } |
| 294 | 293 |
| 295 } // namespace content | 294 } // namespace content |
| 296 | 295 |
| OLD | NEW |