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