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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "content/browser/device_sensors/device_light_message_filter.h" | 43 #include "content/browser/device_sensors/device_light_message_filter.h" |
44 #include "content/browser/device_sensors/device_motion_message_filter.h" | 44 #include "content/browser/device_sensors/device_motion_message_filter.h" |
45 #include "content/browser/device_sensors/device_orientation_message_filter.h" | 45 #include "content/browser/device_sensors/device_orientation_message_filter.h" |
46 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 46 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
47 #include "content/browser/dom_storage/dom_storage_message_filter.h" | 47 #include "content/browser/dom_storage/dom_storage_message_filter.h" |
48 #include "content/browser/download/mhtml_generation_manager.h" | 48 #include "content/browser/download/mhtml_generation_manager.h" |
49 #include "content/browser/fileapi/chrome_blob_storage_context.h" | 49 #include "content/browser/fileapi/chrome_blob_storage_context.h" |
50 #include "content/browser/fileapi/fileapi_message_filter.h" | 50 #include "content/browser/fileapi/fileapi_message_filter.h" |
51 #include "content/browser/frame_host/render_frame_message_filter.h" | 51 #include "content/browser/frame_host/render_frame_message_filter.h" |
52 #include "content/browser/geofencing/geofencing_dispatcher_host.h" | 52 #include "content/browser/geofencing/geofencing_dispatcher_host.h" |
| 53 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
53 #include "content/browser/gpu/compositor_util.h" | 54 #include "content/browser/gpu/compositor_util.h" |
54 #include "content/browser/gpu/gpu_data_manager_impl.h" | 55 #include "content/browser/gpu/gpu_data_manager_impl.h" |
55 #include "content/browser/gpu/gpu_process_host.h" | 56 #include "content/browser/gpu/gpu_process_host.h" |
56 #include "content/browser/gpu/shader_disk_cache.h" | 57 #include "content/browser/gpu/shader_disk_cache.h" |
57 #include "content/browser/histogram_message_filter.h" | 58 #include "content/browser/histogram_message_filter.h" |
58 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 59 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
59 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" | 60 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" |
60 #include "content/browser/loader/resource_message_filter.h" | 61 #include "content/browser/loader/resource_message_filter.h" |
61 #include "content/browser/loader/resource_scheduler_filter.h" | 62 #include "content/browser/loader/resource_scheduler_filter.h" |
62 #include "content/browser/media/capture/audio_mirroring_manager.h" | 63 #include "content/browser/media/capture/audio_mirroring_manager.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 #include "content/browser/shared_worker/worker_storage_partition.h" | 99 #include "content/browser/shared_worker/worker_storage_partition.h" |
99 #include "content/browser/speech/speech_recognition_dispatcher_host.h" | 100 #include "content/browser/speech/speech_recognition_dispatcher_host.h" |
100 #include "content/browser/storage_partition_impl.h" | 101 #include "content/browser/storage_partition_impl.h" |
101 #include "content/browser/streams/stream_context.h" | 102 #include "content/browser/streams/stream_context.h" |
102 #include "content/browser/tracing/trace_message_filter.h" | 103 #include "content/browser/tracing/trace_message_filter.h" |
103 #include "content/browser/vibration/vibration_message_filter.h" | 104 #include "content/browser/vibration/vibration_message_filter.h" |
104 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 105 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
105 #include "content/common/child_process_host_impl.h" | 106 #include "content/common/child_process_host_impl.h" |
106 #include "content/common/child_process_messages.h" | 107 #include "content/common/child_process_messages.h" |
107 #include "content/common/content_switches_internal.h" | 108 #include "content/common/content_switches_internal.h" |
| 109 #include "content/common/gpu/gpu_memory_buffer_factory.h" |
108 #include "content/common/gpu/gpu_messages.h" | 110 #include "content/common/gpu/gpu_messages.h" |
109 #include "content/common/mojo/mojo_messages.h" | 111 #include "content/common/mojo/mojo_messages.h" |
110 #include "content/common/resource_messages.h" | 112 #include "content/common/resource_messages.h" |
111 #include "content/common/view_messages.h" | 113 #include "content/common/view_messages.h" |
112 #include "content/public/browser/browser_context.h" | 114 #include "content/public/browser/browser_context.h" |
113 #include "content/public/browser/content_browser_client.h" | 115 #include "content/public/browser/content_browser_client.h" |
114 #include "content/public/browser/notification_service.h" | 116 #include "content/public/browser/notification_service.h" |
115 #include "content/public/browser/notification_types.h" | 117 #include "content/public/browser/notification_types.h" |
116 #include "content/public/browser/render_process_host_factory.h" | 118 #include "content/public/browser/render_process_host_factory.h" |
117 #include "content/public/browser/render_process_host_observer.h" | 119 #include "content/public/browser/render_process_host_observer.h" |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 switches::kNumRasterThreads, | 1016 switches::kNumRasterThreads, |
1015 base::IntToString(NumberOfRendererRasterThreads())); | 1017 base::IntToString(NumberOfRendererRasterThreads())); |
1016 } | 1018 } |
1017 | 1019 |
1018 if (IsGpuRasterizationEnabled()) | 1020 if (IsGpuRasterizationEnabled()) |
1019 command_line->AppendSwitch(switches::kEnableGpuRasterization); | 1021 command_line->AppendSwitch(switches::kEnableGpuRasterization); |
1020 | 1022 |
1021 if (IsForceGpuRasterizationEnabled()) | 1023 if (IsForceGpuRasterizationEnabled()) |
1022 command_line->AppendSwitch(switches::kForceGpuRasterization); | 1024 command_line->AppendSwitch(switches::kForceGpuRasterization); |
1023 | 1025 |
| 1026 if (BrowserGpuChannelHostFactory::IsGpuMemoryBufferFactoryUsageEnabled( |
| 1027 gfx::GpuMemoryBuffer::MAP)) { |
| 1028 std::vector<gfx::GpuMemoryBufferType> supported_types; |
| 1029 GpuMemoryBufferFactory::GetSupportedTypes(&supported_types); |
| 1030 DCHECK(!supported_types.empty()); |
| 1031 |
| 1032 // The GPU service will always use the preferred type. |
| 1033 gfx::GpuMemoryBufferType type = supported_types[0]; |
| 1034 |
| 1035 // Surface texture backed GPU memory buffers require TEXTURE_EXTERNAL_OES. |
| 1036 if (type == gfx::SURFACE_TEXTURE_BUFFER) |
| 1037 command_line->AppendSwitch(switches::kUseImageExternal); |
| 1038 } |
| 1039 |
1024 // Appending disable-gpu-feature switches due to software rendering list. | 1040 // Appending disable-gpu-feature switches due to software rendering list. |
1025 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); | 1041 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
1026 DCHECK(gpu_data_manager); | 1042 DCHECK(gpu_data_manager); |
1027 gpu_data_manager->AppendRendererCommandLine(command_line); | 1043 gpu_data_manager->AppendRendererCommandLine(command_line); |
1028 } | 1044 } |
1029 | 1045 |
1030 void RenderProcessHostImpl::AppendRendererCommandLine( | 1046 void RenderProcessHostImpl::AppendRendererCommandLine( |
1031 base::CommandLine* command_line) const { | 1047 base::CommandLine* command_line) const { |
1032 // Pass the process type first, so it shows first in process listings. | 1048 // Pass the process type first, so it shows first in process listings. |
1033 command_line->AppendSwitchASCII(switches::kProcessType, | 1049 command_line->AppendSwitchASCII(switches::kProcessType, |
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2248 | 2264 |
2249 void RenderProcessHostImpl::DecrementWorkerRefCount() { | 2265 void RenderProcessHostImpl::DecrementWorkerRefCount() { |
2250 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 2266 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
2251 DCHECK_GT(worker_ref_count_, 0); | 2267 DCHECK_GT(worker_ref_count_, 0); |
2252 --worker_ref_count_; | 2268 --worker_ref_count_; |
2253 if (worker_ref_count_ == 0) | 2269 if (worker_ref_count_ == 0) |
2254 Cleanup(); | 2270 Cleanup(); |
2255 } | 2271 } |
2256 | 2272 |
2257 } // namespace content | 2273 } // namespace content |
OLD | NEW |