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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 if (!in_browser_process_) | 254 if (!in_browser_process_) |
255 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); | 255 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); |
256 | 256 |
257 // Defer creation of the render thread. This is to prevent it from handling | 257 // Defer creation of the render thread. This is to prevent it from handling |
258 // IPC messages before the sandbox has been enabled and all other necessary | 258 // IPC messages before the sandbox has been enabled and all other necessary |
259 // initialization has succeeded. | 259 // initialization has succeeded. |
260 gpu_channel_manager_.reset(new GpuChannelManager( | 260 gpu_channel_manager_.reset(new GpuChannelManager( |
261 channel(), watchdog_thread_.get(), | 261 channel(), watchdog_thread_.get(), |
262 base::ThreadTaskRunnerHandle::Get().get(), | 262 base::ThreadTaskRunnerHandle::Get().get(), |
263 ChildProcess::current()->io_task_runner(), | 263 ChildProcess::current()->io_task_runner(), |
264 ChildProcess::current()->GetShutDownEvent(), GetAttachmentBroker(), | 264 ChildProcess::current()->GetShutDownEvent(), |
265 sync_point_manager_, gpu_memory_buffer_factory_)); | 265 sync_point_manager_, gpu_memory_buffer_factory_)); |
266 | 266 |
267 #if defined(USE_OZONE) | 267 #if defined(USE_OZONE) |
268 ui::OzonePlatform::GetInstance() | 268 ui::OzonePlatform::GetInstance() |
269 ->GetGpuPlatformSupport() | 269 ->GetGpuPlatformSupport() |
270 ->OnChannelEstablished(this); | 270 ->OnChannelEstablished(this); |
271 #endif | 271 #endif |
272 } | 272 } |
273 | 273 |
274 void GpuChildThread::OnFinalize() { | 274 void GpuChildThread::OnFinalize() { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 } | 368 } |
369 } | 369 } |
370 | 370 |
371 void GpuChildThread::OnGpuSwitched() { | 371 void GpuChildThread::OnGpuSwitched() { |
372 DVLOG(1) << "GPU: GPU has switched"; | 372 DVLOG(1) << "GPU: GPU has switched"; |
373 // Notify observers in the GPU process. | 373 // Notify observers in the GPU process. |
374 ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched(); | 374 ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched(); |
375 } | 375 } |
376 | 376 |
377 } // namespace content | 377 } // namespace content |
OLD | NEW |