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 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 if (IsDelegatedRendererEnabled()) | 1023 if (IsDelegatedRendererEnabled()) |
1021 command_line->AppendSwitch(switches::kEnableDelegatedRenderer); | 1024 command_line->AppendSwitch(switches::kEnableDelegatedRenderer); |
1022 | 1025 |
1023 if (IsImplSidePaintingEnabled()) { | 1026 if (IsImplSidePaintingEnabled()) { |
1024 command_line->AppendSwitch(switches::kEnableImplSidePainting); | 1027 command_line->AppendSwitch(switches::kEnableImplSidePainting); |
1025 command_line->AppendSwitchASCII( | 1028 command_line->AppendSwitchASCII( |
1026 switches::kNumRasterThreads, | 1029 switches::kNumRasterThreads, |
1027 base::IntToString(NumberOfRendererRasterThreads())); | 1030 base::IntToString(NumberOfRendererRasterThreads())); |
1028 } | 1031 } |
1029 | 1032 |
1030 if (content::IsGpuRasterizationEnabled()) | 1033 if (IsGpuRasterizationEnabled()) |
1031 command_line->AppendSwitch(switches::kEnableGpuRasterization); | 1034 command_line->AppendSwitch(switches::kEnableGpuRasterization); |
1032 | 1035 |
1033 if (content::IsForceGpuRasterizationEnabled()) | 1036 if (IsForceGpuRasterizationEnabled()) |
1034 command_line->AppendSwitch(switches::kForceGpuRasterization); | 1037 command_line->AppendSwitch(switches::kForceGpuRasterization); |
1035 | 1038 |
1036 // Appending disable-gpu-feature switches due to software rendering list. | 1039 // Appending disable-gpu-feature switches due to software rendering list. |
1037 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); | 1040 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
1038 DCHECK(gpu_data_manager); | 1041 DCHECK(gpu_data_manager); |
1039 gpu_data_manager->AppendRendererCommandLine(command_line); | 1042 gpu_data_manager->AppendRendererCommandLine(command_line); |
1040 } | 1043 } |
1041 | 1044 |
1042 void RenderProcessHostImpl::AppendRendererCommandLine( | 1045 void RenderProcessHostImpl::AppendRendererCommandLine( |
1043 base::CommandLine* command_line) const { | 1046 base::CommandLine* command_line) const { |
(...skipping 17 matching lines...) Expand all Loading... |
1061 std::string field_trial_states; | 1064 std::string field_trial_states; |
1062 base::FieldTrialList::StatesToString(&field_trial_states); | 1065 base::FieldTrialList::StatesToString(&field_trial_states); |
1063 if (!field_trial_states.empty()) { | 1066 if (!field_trial_states.empty()) { |
1064 command_line->AppendSwitchASCII(switches::kForceFieldTrials, | 1067 command_line->AppendSwitchASCII(switches::kForceFieldTrials, |
1065 field_trial_states); | 1068 field_trial_states); |
1066 } | 1069 } |
1067 | 1070 |
1068 GetContentClient()->browser()->AppendExtraCommandLineSwitches( | 1071 GetContentClient()->browser()->AppendExtraCommandLineSwitches( |
1069 command_line, GetID()); | 1072 command_line, GetID()); |
1070 | 1073 |
1071 if (content::IsPinchToZoomEnabled()) | 1074 if (IsPinchToZoomEnabled()) |
1072 command_line->AppendSwitch(switches::kEnablePinch); | 1075 command_line->AppendSwitch(switches::kEnablePinch); |
1073 | 1076 |
1074 #if defined(OS_WIN) | 1077 #if defined(OS_WIN) |
1075 command_line->AppendSwitchASCII(switches::kDeviceScaleFactor, | 1078 command_line->AppendSwitchASCII(switches::kDeviceScaleFactor, |
1076 base::DoubleToString(gfx::GetDPIScale())); | 1079 base::DoubleToString(gfx::GetDPIScale())); |
1077 #endif | 1080 #endif |
1078 | 1081 |
1079 AppendCompositorCommandLineFlags(command_line); | 1082 AppendCompositorCommandLineFlags(command_line); |
1080 } | 1083 } |
1081 | 1084 |
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2357 } | 2360 } |
2358 | 2361 |
2359 void RenderProcessHostImpl::OnDeletedGpuMemoryBuffer( | 2362 void RenderProcessHostImpl::OnDeletedGpuMemoryBuffer( |
2360 gfx::GpuMemoryBufferType type, | 2363 gfx::GpuMemoryBufferType type, |
2361 const gfx::GpuMemoryBufferId& id) { | 2364 const gfx::GpuMemoryBufferId& id) { |
2362 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 2365 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
2363 GpuMemoryBufferImpl::DeletedByChildProcess(type, id, GetHandle()); | 2366 GpuMemoryBufferImpl::DeletedByChildProcess(type, id, GetHandle()); |
2364 } | 2367 } |
2365 | 2368 |
2366 } // namespace content | 2369 } // namespace content |
OLD | NEW |