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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 #include "content/browser/renderer_host/render_view_host_delegate.h" | 76 #include "content/browser/renderer_host/render_view_host_delegate.h" |
77 #include "content/browser/renderer_host/render_view_host_impl.h" | 77 #include "content/browser/renderer_host/render_view_host_impl.h" |
78 #include "content/browser/renderer_host/render_widget_helper.h" | 78 #include "content/browser/renderer_host/render_widget_helper.h" |
79 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" | 79 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" |
80 #include "content/browser/renderer_host/text_input_client_message_filter.h" | 80 #include "content/browser/renderer_host/text_input_client_message_filter.h" |
81 #include "content/browser/resolve_proxy_msg_helper.h" | 81 #include "content/browser/resolve_proxy_msg_helper.h" |
82 #include "content/browser/storage_partition_impl.h" | 82 #include "content/browser/storage_partition_impl.h" |
83 #include "content/browser/speech/input_tag_speech_dispatcher_host.h" | 83 #include "content/browser/speech/input_tag_speech_dispatcher_host.h" |
84 #include "content/browser/speech/speech_recognition_dispatcher_host.h" | 84 #include "content/browser/speech/speech_recognition_dispatcher_host.h" |
85 #include "content/browser/trace_message_filter.h" | 85 #include "content/browser/trace_message_filter.h" |
86 #include "content/browser/webui/web_ui_controller_factory_registry.h" | |
87 #include "content/browser/worker_host/worker_storage_partition.h" | 86 #include "content/browser/worker_host/worker_storage_partition.h" |
88 #include "content/browser/worker_host/worker_message_filter.h" | 87 #include "content/browser/worker_host/worker_message_filter.h" |
89 #include "content/common/child_process_host_impl.h" | 88 #include "content/common/child_process_host_impl.h" |
90 #include "content/common/child_process_messages.h" | 89 #include "content/common/child_process_messages.h" |
91 #include "content/common/gpu/gpu_messages.h" | 90 #include "content/common/gpu/gpu_messages.h" |
92 #include "content/common/resource_messages.h" | 91 #include "content/common/resource_messages.h" |
93 #include "content/common/view_messages.h" | 92 #include "content/common/view_messages.h" |
94 #include "content/public/browser/browser_context.h" | 93 #include "content/public/browser/browser_context.h" |
95 #include "content/public/browser/content_browser_client.h" | 94 #include "content/public/browser/content_browser_client.h" |
96 #include "content/public/browser/notification_service.h" | 95 #include "content/public/browser/notification_service.h" |
97 #include "content/public/browser/notification_types.h" | 96 #include "content/public/browser/notification_types.h" |
98 #include "content/public/browser/render_process_host_factory.h" | 97 #include "content/public/browser/render_process_host_factory.h" |
99 #include "content/public/browser/resource_context.h" | 98 #include "content/public/browser/resource_context.h" |
100 #include "content/public/browser/user_metrics.h" | 99 #include "content/public/browser/user_metrics.h" |
| 100 #include "content/public/browser/web_ui_controller_factory.h" |
101 #include "content/public/common/content_constants.h" | 101 #include "content/public/common/content_constants.h" |
102 #include "content/public/common/content_switches.h" | 102 #include "content/public/common/content_switches.h" |
103 #include "content/public/common/process_type.h" | 103 #include "content/public/common/process_type.h" |
104 #include "content/public/common/result_codes.h" | 104 #include "content/public/common/result_codes.h" |
105 #include "content/public/common/url_constants.h" | 105 #include "content/public/common/url_constants.h" |
106 #include "content/renderer/render_process_impl.h" | 106 #include "content/renderer/render_process_impl.h" |
107 #include "content/renderer/render_thread_impl.h" | 107 #include "content/renderer/render_thread_impl.h" |
108 #include "ipc/ipc_channel.h" | 108 #include "ipc/ipc_channel.h" |
109 #include "ipc/ipc_logging.h" | 109 #include "ipc/ipc_logging.h" |
110 #include "ipc/ipc_platform_file.h" | 110 #include "ipc/ipc_platform_file.h" |
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 // All URLs are suitable if this is associated with a guest renderer process. | 1261 // All URLs are suitable if this is associated with a guest renderer process. |
1262 // TODO(fsamuel, creis): Further validation is needed to ensure that only | 1262 // TODO(fsamuel, creis): Further validation is needed to ensure that only |
1263 // normal web URLs are permitted in guest processes. We need to investigate | 1263 // normal web URLs are permitted in guest processes. We need to investigate |
1264 // where this validation should happen. | 1264 // where this validation should happen. |
1265 if (host->IsGuest()) | 1265 if (host->IsGuest()) |
1266 return true; | 1266 return true; |
1267 | 1267 |
1268 if (!host->IsGuest() && site_url.SchemeIs(chrome::kGuestScheme)) | 1268 if (!host->IsGuest() && site_url.SchemeIs(chrome::kGuestScheme)) |
1269 return false; | 1269 return false; |
1270 | 1270 |
1271 if (ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( | 1271 WebUIControllerFactory* factory = |
| 1272 GetContentClient()->browser()->GetWebUIControllerFactory(); |
| 1273 if (factory && |
| 1274 ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( |
1272 host->GetID()) != | 1275 host->GetID()) != |
1273 WebUIControllerFactoryRegistry::GetInstance()->UseWebUIBindingsForURL( | 1276 factory->UseWebUIBindingsForURL(browser_context, site_url)) { |
1274 browser_context, site_url)) { | |
1275 return false; | 1277 return false; |
1276 } | 1278 } |
1277 | 1279 |
1278 return GetContentClient()->browser()->IsSuitableHost(host, site_url); | 1280 return GetContentClient()->browser()->IsSuitableHost(host, site_url); |
1279 } | 1281 } |
1280 | 1282 |
1281 // static | 1283 // static |
1282 bool RenderProcessHost::run_renderer_in_process() { | 1284 bool RenderProcessHost::run_renderer_in_process() { |
1283 return g_run_renderer_in_process_; | 1285 return g_run_renderer_in_process_; |
1284 } | 1286 } |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1380 // We want to consolidate particular sites like WebUI when we are using | 1382 // We want to consolidate particular sites like WebUI when we are using |
1381 // process-per-tab or process-per-site-instance models. | 1383 // process-per-tab or process-per-site-instance models. |
1382 // Note that --single-process is handled in ShouldTryToUseExistingProcessHost. | 1384 // Note that --single-process is handled in ShouldTryToUseExistingProcessHost. |
1383 | 1385 |
1384 if (GetContentClient()->browser()-> | 1386 if (GetContentClient()->browser()-> |
1385 ShouldUseProcessPerSite(browser_context, url)) { | 1387 ShouldUseProcessPerSite(browser_context, url)) { |
1386 return true; | 1388 return true; |
1387 } | 1389 } |
1388 | 1390 |
1389 // DevTools pages have WebUI type but should not reuse the same host. | 1391 // DevTools pages have WebUI type but should not reuse the same host. |
1390 if (WebUIControllerFactoryRegistry::GetInstance()->UseWebUIForURL( | 1392 WebUIControllerFactory* factory = |
1391 browser_context, url) && | 1393 GetContentClient()->browser()->GetWebUIControllerFactory(); |
| 1394 if (factory && |
| 1395 factory->UseWebUIForURL(browser_context, url) && |
1392 !url.SchemeIs(chrome::kChromeDevToolsScheme)) { | 1396 !url.SchemeIs(chrome::kChromeDevToolsScheme)) { |
1393 return true; | 1397 return true; |
1394 } | 1398 } |
1395 | 1399 |
1396 // In all other cases, don't use process-per-site logic. | 1400 // In all other cases, don't use process-per-site logic. |
1397 return false; | 1401 return false; |
1398 } | 1402 } |
1399 | 1403 |
1400 // static | 1404 // static |
1401 RenderProcessHost* RenderProcessHostImpl::GetProcessHostForSite( | 1405 RenderProcessHost* RenderProcessHostImpl::GetProcessHostForSite( |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1595 TRACE_EVENT0("renderer_host", | 1599 TRACE_EVENT0("renderer_host", |
1596 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); | 1600 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); |
1597 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; | 1601 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; |
1598 ack_params.sync_point = 0; | 1602 ack_params.sync_point = 0; |
1599 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, | 1603 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, |
1600 gpu_process_host_id, | 1604 gpu_process_host_id, |
1601 ack_params); | 1605 ack_params); |
1602 } | 1606 } |
1603 | 1607 |
1604 } // namespace content | 1608 } // namespace content |
OLD | NEW |