Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 11783038: Allow multiple WebUIControllerFactory objects to be registered. This makes is possible to implement… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: reland after bogus revert of r175971 Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/base/chrome_test_suite.cc ('k') | content/browser/site_instance_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 #include "content/browser/renderer_host/render_view_host_delegate.h" 78 #include "content/browser/renderer_host/render_view_host_delegate.h"
79 #include "content/browser/renderer_host/render_view_host_impl.h" 79 #include "content/browser/renderer_host/render_view_host_impl.h"
80 #include "content/browser/renderer_host/render_widget_helper.h" 80 #include "content/browser/renderer_host/render_widget_helper.h"
81 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" 81 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h"
82 #include "content/browser/renderer_host/text_input_client_message_filter.h" 82 #include "content/browser/renderer_host/text_input_client_message_filter.h"
83 #include "content/browser/resolve_proxy_msg_helper.h" 83 #include "content/browser/resolve_proxy_msg_helper.h"
84 #include "content/browser/storage_partition_impl.h" 84 #include "content/browser/storage_partition_impl.h"
85 #include "content/browser/speech/input_tag_speech_dispatcher_host.h" 85 #include "content/browser/speech/input_tag_speech_dispatcher_host.h"
86 #include "content/browser/speech/speech_recognition_dispatcher_host.h" 86 #include "content/browser/speech/speech_recognition_dispatcher_host.h"
87 #include "content/browser/trace_message_filter.h" 87 #include "content/browser/trace_message_filter.h"
88 #include "content/browser/webui/web_ui_controller_factory_registry.h"
88 #include "content/browser/worker_host/worker_storage_partition.h" 89 #include "content/browser/worker_host/worker_storage_partition.h"
89 #include "content/browser/worker_host/worker_message_filter.h" 90 #include "content/browser/worker_host/worker_message_filter.h"
90 #include "content/common/child_process_host_impl.h" 91 #include "content/common/child_process_host_impl.h"
91 #include "content/common/child_process_messages.h" 92 #include "content/common/child_process_messages.h"
92 #include "content/common/gpu/gpu_messages.h" 93 #include "content/common/gpu/gpu_messages.h"
93 #include "content/common/resource_messages.h" 94 #include "content/common/resource_messages.h"
94 #include "content/common/view_messages.h" 95 #include "content/common/view_messages.h"
95 #include "content/public/browser/browser_context.h" 96 #include "content/public/browser/browser_context.h"
96 #include "content/public/browser/content_browser_client.h" 97 #include "content/public/browser/content_browser_client.h"
97 #include "content/public/browser/notification_service.h" 98 #include "content/public/browser/notification_service.h"
98 #include "content/public/browser/notification_types.h" 99 #include "content/public/browser/notification_types.h"
99 #include "content/public/browser/render_process_host_factory.h" 100 #include "content/public/browser/render_process_host_factory.h"
100 #include "content/public/browser/resource_context.h" 101 #include "content/public/browser/resource_context.h"
101 #include "content/public/browser/user_metrics.h" 102 #include "content/public/browser/user_metrics.h"
102 #include "content/public/browser/web_ui_controller_factory.h"
103 #include "content/public/common/content_constants.h" 103 #include "content/public/common/content_constants.h"
104 #include "content/public/common/content_switches.h" 104 #include "content/public/common/content_switches.h"
105 #include "content/public/common/process_type.h" 105 #include "content/public/common/process_type.h"
106 #include "content/public/common/result_codes.h" 106 #include "content/public/common/result_codes.h"
107 #include "content/public/common/url_constants.h" 107 #include "content/public/common/url_constants.h"
108 #include "content/renderer/render_process_impl.h" 108 #include "content/renderer/render_process_impl.h"
109 #include "content/renderer/render_thread_impl.h" 109 #include "content/renderer/render_thread_impl.h"
110 #include "ipc/ipc_channel.h" 110 #include "ipc/ipc_channel.h"
111 #include "ipc/ipc_logging.h" 111 #include "ipc/ipc_logging.h"
112 #include "ipc/ipc_platform_file.h" 112 #include "ipc/ipc_platform_file.h"
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1279 // All URLs are suitable if this is associated with a guest renderer process. 1279 // All URLs are suitable if this is associated with a guest renderer process.
1280 // TODO(fsamuel, creis): Further validation is needed to ensure that only 1280 // TODO(fsamuel, creis): Further validation is needed to ensure that only
1281 // normal web URLs are permitted in guest processes. We need to investigate 1281 // normal web URLs are permitted in guest processes. We need to investigate
1282 // where this validation should happen. 1282 // where this validation should happen.
1283 if (host->IsGuest()) 1283 if (host->IsGuest())
1284 return true; 1284 return true;
1285 1285
1286 if (!host->IsGuest() && site_url.SchemeIs(chrome::kGuestScheme)) 1286 if (!host->IsGuest() && site_url.SchemeIs(chrome::kGuestScheme))
1287 return false; 1287 return false;
1288 1288
1289 WebUIControllerFactory* factory = 1289 if (ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings(
1290 GetContentClient()->browser()->GetWebUIControllerFactory();
1291 if (factory &&
1292 ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings(
1293 host->GetID()) != 1290 host->GetID()) !=
1294 factory->UseWebUIBindingsForURL(browser_context, site_url)) { 1291 WebUIControllerFactoryRegistry::GetInstance()->UseWebUIBindingsForURL(
1292 browser_context, site_url)) {
1295 return false; 1293 return false;
1296 } 1294 }
1297 1295
1298 return GetContentClient()->browser()->IsSuitableHost(host, site_url); 1296 return GetContentClient()->browser()->IsSuitableHost(host, site_url);
1299 } 1297 }
1300 1298
1301 // static 1299 // static
1302 bool RenderProcessHost::run_renderer_in_process() { 1300 bool RenderProcessHost::run_renderer_in_process() {
1303 return g_run_renderer_in_process_; 1301 return g_run_renderer_in_process_;
1304 } 1302 }
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 // We want to consolidate particular sites like WebUI when we are using 1398 // We want to consolidate particular sites like WebUI when we are using
1401 // process-per-tab or process-per-site-instance models. 1399 // process-per-tab or process-per-site-instance models.
1402 // Note that --single-process is handled in ShouldTryToUseExistingProcessHost. 1400 // Note that --single-process is handled in ShouldTryToUseExistingProcessHost.
1403 1401
1404 if (GetContentClient()->browser()-> 1402 if (GetContentClient()->browser()->
1405 ShouldUseProcessPerSite(browser_context, url)) { 1403 ShouldUseProcessPerSite(browser_context, url)) {
1406 return true; 1404 return true;
1407 } 1405 }
1408 1406
1409 // DevTools pages have WebUI type but should not reuse the same host. 1407 // DevTools pages have WebUI type but should not reuse the same host.
1410 WebUIControllerFactory* factory = 1408 if (WebUIControllerFactoryRegistry::GetInstance()->UseWebUIForURL(
1411 GetContentClient()->browser()->GetWebUIControllerFactory(); 1409 browser_context, url) &&
1412 if (factory &&
1413 factory->UseWebUIForURL(browser_context, url) &&
1414 !url.SchemeIs(chrome::kChromeDevToolsScheme)) { 1410 !url.SchemeIs(chrome::kChromeDevToolsScheme)) {
1415 return true; 1411 return true;
1416 } 1412 }
1417 1413
1418 // In all other cases, don't use process-per-site logic. 1414 // In all other cases, don't use process-per-site logic.
1419 return false; 1415 return false;
1420 } 1416 }
1421 1417
1422 // static 1418 // static
1423 RenderProcessHost* RenderProcessHostImpl::GetProcessHostForSite( 1419 RenderProcessHost* RenderProcessHostImpl::GetProcessHostForSite(
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1617 TRACE_EVENT0("renderer_host", 1613 TRACE_EVENT0("renderer_host",
1618 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); 1614 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost");
1619 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; 1615 AcceleratedSurfaceMsg_BufferPresented_Params ack_params;
1620 ack_params.sync_point = 0; 1616 ack_params.sync_point = 0;
1621 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, 1617 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id,
1622 gpu_process_host_id, 1618 gpu_process_host_id,
1623 ack_params); 1619 ack_params);
1624 } 1620 }
1625 1621
1626 } // namespace content 1622 } // namespace content
OLDNEW
« no previous file with comments | « chrome/test/base/chrome_test_suite.cc ('k') | content/browser/site_instance_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698