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/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "base/threading/worker_pool.h" | 13 #include "base/threading/worker_pool.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "content/child/child_process.h" | 15 #include "content/child/child_process.h" |
16 #include "content/child/thread_safe_sender.h" | 16 #include "content/child/thread_safe_sender.h" |
17 #include "content/common/gpu/establish_channel_params.h" | 17 #include "content/common/gpu/establish_channel_params.h" |
18 #include "content/common/gpu/gpu_host_messages.h" | 18 #include "content/common/gpu/gpu_host_messages.h" |
19 #include "content/common/gpu/gpu_memory_buffer_factory.h" | 19 #include "content/common/gpu/gpu_memory_buffer_factory.h" |
20 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" | 20 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" |
21 #include "content/gpu/gpu_process_control_impl.h" | 21 #include "content/gpu/gpu_process_control_impl.h" |
22 #include "content/gpu/gpu_watchdog_thread.h" | 22 #include "content/gpu/gpu_watchdog_thread.h" |
23 #include "content/public/common/content_client.h" | 23 #include "content/public/common/content_client.h" |
24 #include "content/public/common/content_switches.h" | 24 #include "content/public/common/content_switches.h" |
25 #include "content/public/gpu/content_gpu_client.h" | 25 #include "content/public/gpu/content_gpu_client.h" |
26 #include "gpu/command_buffer/service/gpu_switches.h" | 26 #include "gpu/command_buffer/service/gpu_switches.h" |
27 #include "gpu/config/gpu_info_collector.h" | 27 #include "gpu/config/gpu_info_collector.h" |
28 #include "gpu/config/gpu_switches.h" | 28 #include "gpu/config/gpu_switches.h" |
29 #include "gpu/config/gpu_util.h" | 29 #include "gpu/config/gpu_util.h" |
| 30 #include "gpu/ipc/common/memory_stats.h" |
30 #include "ipc/ipc_channel_handle.h" | 31 #include "ipc/ipc_channel_handle.h" |
31 #include "ipc/ipc_sync_message_filter.h" | 32 #include "ipc/ipc_sync_message_filter.h" |
32 #include "ui/gl/gl_implementation.h" | 33 #include "ui/gl/gl_implementation.h" |
33 #include "ui/gl/gl_switches.h" | 34 #include "ui/gl/gl_switches.h" |
34 #include "ui/gl/gpu_switching_manager.h" | 35 #include "ui/gl/gpu_switching_manager.h" |
35 | 36 |
36 #if defined(USE_OZONE) | 37 #if defined(USE_OZONE) |
37 #include "ui/ozone/public/gpu_platform_support.h" | 38 #include "ui/ozone/public/gpu_platform_support.h" |
38 #include "ui/ozone/public/ozone_platform.h" | 39 #include "ui/ozone/public/ozone_platform.h" |
39 #endif | 40 #endif |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 | 503 |
503 #if defined(OS_WIN) | 504 #if defined(OS_WIN) |
504 if (!in_browser_process_) { | 505 if (!in_browser_process_) { |
505 // The unsandboxed GPU process fulfilled its duty. Rest in peace. | 506 // The unsandboxed GPU process fulfilled its duty. Rest in peace. |
506 base::MessageLoop::current()->QuitWhenIdle(); | 507 base::MessageLoop::current()->QuitWhenIdle(); |
507 } | 508 } |
508 #endif // OS_WIN | 509 #endif // OS_WIN |
509 } | 510 } |
510 | 511 |
511 void GpuChildThread::OnGetVideoMemoryUsageStats() { | 512 void GpuChildThread::OnGetVideoMemoryUsageStats() { |
512 GPUVideoMemoryUsageStats video_memory_usage_stats; | 513 gpu::VideoMemoryUsageStats video_memory_usage_stats; |
513 if (gpu_channel_manager_) { | 514 if (gpu_channel_manager_) { |
514 gpu_channel_manager_->gpu_memory_manager()->GetVideoMemoryUsageStats( | 515 gpu_channel_manager_->gpu_memory_manager()->GetVideoMemoryUsageStats( |
515 &video_memory_usage_stats); | 516 &video_memory_usage_stats); |
516 } | 517 } |
517 Send(new GpuHostMsg_VideoMemoryUsageStats(video_memory_usage_stats)); | 518 Send(new GpuHostMsg_VideoMemoryUsageStats(video_memory_usage_stats)); |
518 } | 519 } |
519 | 520 |
520 void GpuChildThread::OnClean() { | 521 void GpuChildThread::OnClean() { |
521 DVLOG(1) << "GPU: Removing all contexts"; | 522 DVLOG(1) << "GPU: Removing all contexts"; |
522 if (gpu_channel_manager_) | 523 if (gpu_channel_manager_) |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 | 608 |
608 void GpuChildThread::BindProcessControlRequest( | 609 void GpuChildThread::BindProcessControlRequest( |
609 mojo::InterfaceRequest<ProcessControl> request) { | 610 mojo::InterfaceRequest<ProcessControl> request) { |
610 DVLOG(1) << "GPU: Binding ProcessControl request"; | 611 DVLOG(1) << "GPU: Binding ProcessControl request"; |
611 DCHECK(process_control_); | 612 DCHECK(process_control_); |
612 process_control_bindings_.AddBinding(process_control_.get(), | 613 process_control_bindings_.AddBinding(process_control_.get(), |
613 std::move(request)); | 614 std::move(request)); |
614 } | 615 } |
615 | 616 |
616 } // namespace content | 617 } // namespace content |
OLD | NEW |