OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/browser/frame_host/render_frame_host_manager.h" | 5 #include "content/browser/frame_host/render_frame_host_manager.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 // If the pending navigation is to a WebUI and the RenderView is not in a | 1011 // If the pending navigation is to a WebUI and the RenderView is not in a |
1012 // guest process, tell the RenderViewHost about any bindings it will need | 1012 // guest process, tell the RenderViewHost about any bindings it will need |
1013 // enabled. | 1013 // enabled. |
1014 if (pending_web_ui() && !render_view_host->GetProcess()->IsGuest()) { | 1014 if (pending_web_ui() && !render_view_host->GetProcess()->IsGuest()) { |
1015 render_view_host->AllowBindings(pending_web_ui()->GetBindings()); | 1015 render_view_host->AllowBindings(pending_web_ui()->GetBindings()); |
1016 } else { | 1016 } else { |
1017 // Ensure that we don't create an unprivileged RenderView in a WebUI-enabled | 1017 // Ensure that we don't create an unprivileged RenderView in a WebUI-enabled |
1018 // process unless it's swapped out. | 1018 // process unless it's swapped out. |
1019 RenderViewHostImpl* rvh_impl = | 1019 RenderViewHostImpl* rvh_impl = |
1020 static_cast<RenderViewHostImpl*>(render_view_host); | 1020 static_cast<RenderViewHostImpl*>(render_view_host); |
1021 if (!rvh_impl->IsSwappedOut()) { | 1021 // In single-process mode, we are forced to create all render views in |
| 1022 // the same single process. |
| 1023 bool single_process = |
| 1024 RenderProcessHost::run_renderer_in_process(); |
| 1025 if (!rvh_impl->IsSwappedOut() && !single_process) { |
1022 CHECK(!ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( | 1026 CHECK(!ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( |
1023 render_view_host->GetProcess()->GetID())); | 1027 render_view_host->GetProcess()->GetID())); |
1024 } | 1028 } |
1025 } | 1029 } |
1026 | 1030 |
1027 return delegate_->CreateRenderViewForRenderManager( | 1031 return delegate_->CreateRenderViewForRenderManager( |
1028 render_view_host, opener_route_id, proxy_routing_id, for_main_frame); | 1032 render_view_host, opener_route_id, proxy_routing_id, for_main_frame); |
1029 } | 1033 } |
1030 | 1034 |
1031 void RenderFrameHostManager::CommitPending() { | 1035 void RenderFrameHostManager::CommitPending() { |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1480 SiteInstance* instance) const { | 1484 SiteInstance* instance) const { |
1481 RenderFrameProxyHostMap::const_iterator iter = | 1485 RenderFrameProxyHostMap::const_iterator iter = |
1482 proxy_hosts_.find(instance->GetId()); | 1486 proxy_hosts_.find(instance->GetId()); |
1483 if (iter != proxy_hosts_.end()) | 1487 if (iter != proxy_hosts_.end()) |
1484 return iter->second; | 1488 return iter->second; |
1485 | 1489 |
1486 return NULL; | 1490 return NULL; |
1487 } | 1491 } |
1488 | 1492 |
1489 } // namespace content | 1493 } // namespace content |
OLD | NEW |