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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 63 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
64 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" | 64 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" |
65 #include "content/browser/loader/resource_message_filter.h" | 65 #include "content/browser/loader/resource_message_filter.h" |
66 #include "content/browser/loader/resource_scheduler_filter.h" | 66 #include "content/browser/loader/resource_scheduler_filter.h" |
67 #include "content/browser/media/capture/audio_mirroring_manager.h" | 67 #include "content/browser/media/capture/audio_mirroring_manager.h" |
68 #include "content/browser/media/media_internals.h" | 68 #include "content/browser/media/media_internals.h" |
69 #include "content/browser/media/midi_host.h" | 69 #include "content/browser/media/midi_host.h" |
70 #include "content/browser/message_port_message_filter.h" | 70 #include "content/browser/message_port_message_filter.h" |
71 #include "content/browser/mime_registry_message_filter.h" | 71 #include "content/browser/mime_registry_message_filter.h" |
72 #include "content/browser/mojo/mojo_application_host.h" | 72 #include "content/browser/mojo/mojo_application_host.h" |
73 #include "content/browser/plugin_service_impl.h" | |
74 #include "content/browser/profiler_message_filter.h" | 73 #include "content/browser/profiler_message_filter.h" |
75 #include "content/browser/push_messaging_message_filter.h" | 74 #include "content/browser/push_messaging_message_filter.h" |
76 #include "content/browser/quota_dispatcher_host.h" | 75 #include "content/browser/quota_dispatcher_host.h" |
77 #include "content/browser/renderer_host/clipboard_message_filter.h" | 76 #include "content/browser/renderer_host/clipboard_message_filter.h" |
78 #include "content/browser/renderer_host/database_message_filter.h" | 77 #include "content/browser/renderer_host/database_message_filter.h" |
79 #include "content/browser/renderer_host/file_utilities_message_filter.h" | 78 #include "content/browser/renderer_host/file_utilities_message_filter.h" |
80 #include "content/browser/renderer_host/gamepad_browser_message_filter.h" | 79 #include "content/browser/renderer_host/gamepad_browser_message_filter.h" |
81 #include "content/browser/renderer_host/gpu_message_filter.h" | 80 #include "content/browser/renderer_host/gpu_message_filter.h" |
82 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" | 81 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" |
83 #include "content/browser/renderer_host/media/audio_renderer_host.h" | 82 #include "content/browser/renderer_host/media/audio_renderer_host.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 #include "content/common/gpu/client/gpu_memory_buffer_impl_io_surface.h" | 160 #include "content/common/gpu/client/gpu_memory_buffer_impl_io_surface.h" |
162 #endif | 161 #endif |
163 | 162 |
164 #if defined(OS_WIN) | 163 #if defined(OS_WIN) |
165 #include "base/win/scoped_com_initializer.h" | 164 #include "base/win/scoped_com_initializer.h" |
166 #include "content/common/font_cache_dispatcher_win.h" | 165 #include "content/common/font_cache_dispatcher_win.h" |
167 #include "content/common/sandbox_win.h" | 166 #include "content/common/sandbox_win.h" |
168 #include "ui/gfx/win/dpi.h" | 167 #include "ui/gfx/win/dpi.h" |
169 #endif | 168 #endif |
170 | 169 |
| 170 #if defined(ENABLE_PLUGINS) |
| 171 #include "content/browser/plugin_service_impl.h" |
| 172 #endif |
| 173 |
171 #if defined(ENABLE_WEBRTC) | 174 #if defined(ENABLE_WEBRTC) |
172 #include "content/browser/media/webrtc_internals.h" | 175 #include "content/browser/media/webrtc_internals.h" |
173 #include "content/browser/renderer_host/media/media_stream_track_metrics_host.h" | 176 #include "content/browser/renderer_host/media/media_stream_track_metrics_host.h" |
174 #include "content/browser/renderer_host/media/webrtc_identity_service_host.h" | 177 #include "content/browser/renderer_host/media/webrtc_identity_service_host.h" |
175 #include "content/browser/renderer_host/p2p/socket_dispatcher_host.h" | 178 #include "content/browser/renderer_host/p2p/socket_dispatcher_host.h" |
176 #include "content/common/media/aec_dump_messages.h" | 179 #include "content/common/media/aec_dump_messages.h" |
177 #include "content/common/media/media_stream_messages.h" | 180 #include "content/common/media/media_stream_messages.h" |
178 #endif | 181 #endif |
179 | 182 |
180 extern bool g_exited_main_message_loop; | 183 extern bool g_exited_main_message_loop; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 context->GetUserData(kSiteProcessMapKeyName)); | 297 context->GetUserData(kSiteProcessMapKeyName)); |
295 if (!map) { | 298 if (!map) { |
296 map = new SiteProcessMap(); | 299 map = new SiteProcessMap(); |
297 context->SetUserData(kSiteProcessMapKeyName, map); | 300 context->SetUserData(kSiteProcessMapKeyName, map); |
298 } | 301 } |
299 return map; | 302 return map; |
300 } | 303 } |
301 | 304 |
302 // NOTE: changes to this class need to be reviewed by the security team. | 305 // NOTE: changes to this class need to be reviewed by the security team. |
303 class RendererSandboxedProcessLauncherDelegate | 306 class RendererSandboxedProcessLauncherDelegate |
304 : public content::SandboxedProcessLauncherDelegate { | 307 : public SandboxedProcessLauncherDelegate { |
305 public: | 308 public: |
306 explicit RendererSandboxedProcessLauncherDelegate(IPC::ChannelProxy* channel) | 309 explicit RendererSandboxedProcessLauncherDelegate(IPC::ChannelProxy* channel) |
307 #if defined(OS_POSIX) | 310 #if defined(OS_POSIX) |
308 : ipc_fd_(channel->TakeClientFileDescriptor()) | 311 : ipc_fd_(channel->TakeClientFileDescriptor()) |
309 #endif // OS_POSIX | 312 #endif // OS_POSIX |
310 {} | 313 {} |
311 | 314 |
312 virtual ~RendererSandboxedProcessLauncherDelegate() {} | 315 virtual ~RendererSandboxedProcessLauncherDelegate() {} |
313 | 316 |
314 #if defined(OS_WIN) | 317 #if defined(OS_WIN) |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 if (IsDelegatedRendererEnabled()) | 1022 if (IsDelegatedRendererEnabled()) |
1020 command_line->AppendSwitch(switches::kEnableDelegatedRenderer); | 1023 command_line->AppendSwitch(switches::kEnableDelegatedRenderer); |
1021 | 1024 |
1022 if (IsImplSidePaintingEnabled()) { | 1025 if (IsImplSidePaintingEnabled()) { |
1023 command_line->AppendSwitch(switches::kEnableImplSidePainting); | 1026 command_line->AppendSwitch(switches::kEnableImplSidePainting); |
1024 command_line->AppendSwitchASCII( | 1027 command_line->AppendSwitchASCII( |
1025 switches::kNumRasterThreads, | 1028 switches::kNumRasterThreads, |
1026 base::IntToString(NumberOfRendererRasterThreads())); | 1029 base::IntToString(NumberOfRendererRasterThreads())); |
1027 } | 1030 } |
1028 | 1031 |
1029 if (content::IsGpuRasterizationEnabled()) | 1032 if (IsGpuRasterizationEnabled()) |
1030 command_line->AppendSwitch(switches::kEnableGpuRasterization); | 1033 command_line->AppendSwitch(switches::kEnableGpuRasterization); |
1031 | 1034 |
1032 if (content::IsForceGpuRasterizationEnabled()) | 1035 if (IsForceGpuRasterizationEnabled()) |
1033 command_line->AppendSwitch(switches::kForceGpuRasterization); | 1036 command_line->AppendSwitch(switches::kForceGpuRasterization); |
1034 | 1037 |
1035 // Appending disable-gpu-feature switches due to software rendering list. | 1038 // Appending disable-gpu-feature switches due to software rendering list. |
1036 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); | 1039 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
1037 DCHECK(gpu_data_manager); | 1040 DCHECK(gpu_data_manager); |
1038 gpu_data_manager->AppendRendererCommandLine(command_line); | 1041 gpu_data_manager->AppendRendererCommandLine(command_line); |
1039 } | 1042 } |
1040 | 1043 |
1041 void RenderProcessHostImpl::AppendRendererCommandLine( | 1044 void RenderProcessHostImpl::AppendRendererCommandLine( |
1042 base::CommandLine* command_line) const { | 1045 base::CommandLine* command_line) const { |
(...skipping 17 matching lines...) Expand all Loading... |
1060 std::string field_trial_states; | 1063 std::string field_trial_states; |
1061 base::FieldTrialList::StatesToString(&field_trial_states); | 1064 base::FieldTrialList::StatesToString(&field_trial_states); |
1062 if (!field_trial_states.empty()) { | 1065 if (!field_trial_states.empty()) { |
1063 command_line->AppendSwitchASCII(switches::kForceFieldTrials, | 1066 command_line->AppendSwitchASCII(switches::kForceFieldTrials, |
1064 field_trial_states); | 1067 field_trial_states); |
1065 } | 1068 } |
1066 | 1069 |
1067 GetContentClient()->browser()->AppendExtraCommandLineSwitches( | 1070 GetContentClient()->browser()->AppendExtraCommandLineSwitches( |
1068 command_line, GetID()); | 1071 command_line, GetID()); |
1069 | 1072 |
1070 if (content::IsPinchToZoomEnabled()) | 1073 if (IsPinchToZoomEnabled()) |
1071 command_line->AppendSwitch(switches::kEnablePinch); | 1074 command_line->AppendSwitch(switches::kEnablePinch); |
1072 | 1075 |
1073 #if defined(OS_WIN) | 1076 #if defined(OS_WIN) |
1074 command_line->AppendSwitchASCII(switches::kDeviceScaleFactor, | 1077 command_line->AppendSwitchASCII(switches::kDeviceScaleFactor, |
1075 base::DoubleToString(gfx::GetDPIScale())); | 1078 base::DoubleToString(gfx::GetDPIScale())); |
1076 #endif | 1079 #endif |
1077 | 1080 |
1078 AppendCompositorCommandLineFlags(command_line); | 1081 AppendCompositorCommandLineFlags(command_line); |
1079 } | 1082 } |
1080 | 1083 |
(...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2365 } | 2368 } |
2366 | 2369 |
2367 void RenderProcessHostImpl::OnDeletedGpuMemoryBuffer( | 2370 void RenderProcessHostImpl::OnDeletedGpuMemoryBuffer( |
2368 gfx::GpuMemoryBufferType type, | 2371 gfx::GpuMemoryBufferType type, |
2369 const gfx::GpuMemoryBufferId& id) { | 2372 const gfx::GpuMemoryBufferId& id) { |
2370 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 2373 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
2371 GpuMemoryBufferImpl::DeletedByChildProcess(type, id, GetHandle()); | 2374 GpuMemoryBufferImpl::DeletedByChildProcess(type, id, GetHandle()); |
2372 } | 2375 } |
2373 | 2376 |
2374 } // namespace content | 2377 } // namespace content |
OLD | NEW |