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