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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 #endif | 171 #endif |
172 | 172 |
173 // 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 |
174 // the browser process. | 174 // the browser process. |
175 if (!in_browser_process_) | 175 if (!in_browser_process_) |
176 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); | 176 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); |
177 | 177 |
178 // 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 |
179 // 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 |
180 // initialization has succeeded. | 180 // initialization has succeeded. |
181 gpu_channel_manager_.reset( | 181 gpu_channel_manager_.reset(new GpuChannelManager( |
182 new GpuChannelManager(GetRouter(), | 182 GetRouter(), watchdog_thread_.get(), |
183 watchdog_thread_.get(), | 183 ChildProcess::current()->io_task_runner(), |
184 ChildProcess::current()->io_message_loop_proxy(), | 184 ChildProcess::current()->GetShutDownEvent(), channel())); |
185 ChildProcess::current()->GetShutDownEvent(), | |
186 channel())); | |
187 | 185 |
188 #if defined(USE_OZONE) | 186 #if defined(USE_OZONE) |
189 ui::OzonePlatform::GetInstance() | 187 ui::OzonePlatform::GetInstance() |
190 ->GetGpuPlatformSupport() | 188 ->GetGpuPlatformSupport() |
191 ->OnChannelEstablished(this); | 189 ->OnChannelEstablished(this); |
192 #endif | 190 #endif |
193 } | 191 } |
194 | 192 |
195 void GpuChildThread::StopWatchdog() { | 193 void GpuChildThread::StopWatchdog() { |
196 if (watchdog_thread_.get()) { | 194 if (watchdog_thread_.get()) { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 } | 283 } |
286 | 284 |
287 void GpuChildThread::OnGpuSwitched() { | 285 void GpuChildThread::OnGpuSwitched() { |
288 DVLOG(1) << "GPU: GPU has switched"; | 286 DVLOG(1) << "GPU: GPU has switched"; |
289 // Notify observers in the GPU process. | 287 // Notify observers in the GPU process. |
290 ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched(); | 288 ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched(); |
291 } | 289 } |
292 | 290 |
293 } // namespace content | 291 } // namespace content |
294 | 292 |
OLD | NEW |