| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/threading/worker_pool.h" | 12 #include "base/threading/worker_pool.h" |
| 13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 #include "content/child/child_process.h" | 14 #include "content/child/child_process.h" |
| 15 #include "content/child/thread_safe_sender.h" | 15 #include "content/child/thread_safe_sender.h" |
| 16 #include "content/common/gpu/gpu_memory_buffer_factory.h" | 16 #include "content/common/gpu/gpu_memory_buffer_factory.h" |
| 17 #include "content/common/gpu/gpu_messages.h" | 17 #include "content/common/gpu/gpu_messages.h" |
| 18 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" | 18 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" |
| 19 #include "content/gpu/gpu_process_control_impl.h" | 19 #include "content/gpu/gpu_process_control_impl.h" |
| 20 #include "content/gpu/gpu_watchdog_thread.h" | 20 #include "content/gpu/gpu_watchdog_thread.h" |
| 21 #include "content/public/common/content_client.h" | 21 #include "content/public/common/content_client.h" |
| 22 #include "content/public/common/content_switches.h" | 22 #include "content/public/common/content_switches.h" |
| 23 #include "content/public/gpu/content_gpu_client.h" | 23 #include "content/public/gpu/content_gpu_client.h" |
| 24 #include "gpu/config/gpu_info_collector.h" | 24 #include "gpu/config/gpu_info_collector.h" |
| 25 #include "gpu/ipc/common/memory_stats.h" | |
| 26 #include "ipc/ipc_channel_handle.h" | 25 #include "ipc/ipc_channel_handle.h" |
| 27 #include "ipc/ipc_sync_message_filter.h" | 26 #include "ipc/ipc_sync_message_filter.h" |
| 28 #include "ui/gl/gl_implementation.h" | 27 #include "ui/gl/gl_implementation.h" |
| 29 #include "ui/gl/gpu_switching_manager.h" | 28 #include "ui/gl/gpu_switching_manager.h" |
| 30 | 29 |
| 31 #if defined(USE_OZONE) | 30 #if defined(USE_OZONE) |
| 32 #include "ui/ozone/public/gpu_platform_support.h" | 31 #include "ui/ozone/public/gpu_platform_support.h" |
| 33 #include "ui/ozone/public/ozone_platform.h" | 32 #include "ui/ozone/public/ozone_platform.h" |
| 34 #endif | 33 #endif |
| 35 | 34 |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 | 344 |
| 346 #if defined(OS_WIN) | 345 #if defined(OS_WIN) |
| 347 if (!in_browser_process_) { | 346 if (!in_browser_process_) { |
| 348 // The unsandboxed GPU process fulfilled its duty. Rest in peace. | 347 // The unsandboxed GPU process fulfilled its duty. Rest in peace. |
| 349 base::MessageLoop::current()->QuitWhenIdle(); | 348 base::MessageLoop::current()->QuitWhenIdle(); |
| 350 } | 349 } |
| 351 #endif // OS_WIN | 350 #endif // OS_WIN |
| 352 } | 351 } |
| 353 | 352 |
| 354 void GpuChildThread::OnGetVideoMemoryUsageStats() { | 353 void GpuChildThread::OnGetVideoMemoryUsageStats() { |
| 355 gpu::VideoMemoryUsageStats video_memory_usage_stats; | 354 GPUVideoMemoryUsageStats video_memory_usage_stats; |
| 356 if (gpu_channel_manager_) | 355 if (gpu_channel_manager_) |
| 357 gpu_channel_manager_->gpu_memory_manager()->GetVideoMemoryUsageStats( | 356 gpu_channel_manager_->gpu_memory_manager()->GetVideoMemoryUsageStats( |
| 358 &video_memory_usage_stats); | 357 &video_memory_usage_stats); |
| 359 Send(new GpuHostMsg_VideoMemoryUsageStats(video_memory_usage_stats)); | 358 Send(new GpuHostMsg_VideoMemoryUsageStats(video_memory_usage_stats)); |
| 360 } | 359 } |
| 361 | 360 |
| 362 void GpuChildThread::OnClean() { | 361 void GpuChildThread::OnClean() { |
| 363 DVLOG(1) << "GPU: Removing all contexts"; | 362 DVLOG(1) << "GPU: Removing all contexts"; |
| 364 if (gpu_channel_manager_) | 363 if (gpu_channel_manager_) |
| 365 gpu_channel_manager_->LoseAllContexts(); | 364 gpu_channel_manager_->LoseAllContexts(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 | 399 |
| 401 void GpuChildThread::BindProcessControlRequest( | 400 void GpuChildThread::BindProcessControlRequest( |
| 402 mojo::InterfaceRequest<ProcessControl> request) { | 401 mojo::InterfaceRequest<ProcessControl> request) { |
| 403 DVLOG(1) << "GPU: Binding ProcessControl request"; | 402 DVLOG(1) << "GPU: Binding ProcessControl request"; |
| 404 DCHECK(process_control_); | 403 DCHECK(process_control_); |
| 405 process_control_bindings_.AddBinding(process_control_.get(), | 404 process_control_bindings_.AddBinding(process_control_.get(), |
| 406 std::move(request)); | 405 std::move(request)); |
| 407 } | 406 } |
| 408 | 407 |
| 409 } // namespace content | 408 } // namespace content |
| OLD | NEW |