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 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1216 if (render_view_host->IsRenderViewLive()) | 1216 if (render_view_host->IsRenderViewLive()) |
1217 return true; | 1217 return true; |
1218 | 1218 |
1219 // If the pending navigation is to a WebUI and the RenderView is not in a | 1219 // If the pending navigation is to a WebUI and the RenderView is not in a |
1220 // guest process, tell the RenderViewHost about any bindings it will need | 1220 // guest process, tell the RenderViewHost about any bindings it will need |
1221 // enabled. | 1221 // enabled. |
1222 if (pending_web_ui() && !render_view_host->GetProcess()->IsIsolatedGuest()) { | 1222 if (pending_web_ui() && !render_view_host->GetProcess()->IsIsolatedGuest()) { |
1223 render_view_host->AllowBindings(pending_web_ui()->GetBindings()); | 1223 render_view_host->AllowBindings(pending_web_ui()->GetBindings()); |
1224 } else { | 1224 } else { |
1225 // Ensure that we don't create an unprivileged RenderView in a WebUI-enabled | 1225 // Ensure that we don't create an unprivileged RenderView in a WebUI-enabled |
1226 // process unless it's swapped out. | 1226 // process unless it's swapped out or we run in single-process mode. |
1227 if (!render_view_host->IsSwappedOut()) { | 1227 bool is_single_process = RenderProcessHost::run_renderer_in_process(); |
nasko
2014/09/29 22:21:48
nit: why create a local variable when you can just
Krzysztof Olczyk
2014/10/01 10:17:47
Done
| |
1228 if (!render_view_host->IsSwappedOut() && !is_single_process) { | |
1228 CHECK(!ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( | 1229 CHECK(!ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( |
1229 render_view_host->GetProcess()->GetID())); | 1230 render_view_host->GetProcess()->GetID())); |
1230 } | 1231 } |
1231 } | 1232 } |
1232 | 1233 |
1233 return delegate_->CreateRenderViewForRenderManager(render_view_host, | 1234 return delegate_->CreateRenderViewForRenderManager(render_view_host, |
1234 opener_route_id, | 1235 opener_route_id, |
1235 proxy_routing_id, | 1236 proxy_routing_id, |
1236 for_main_frame_navigation); | 1237 for_main_frame_navigation); |
1237 } | 1238 } |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1712 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 1713 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
1713 SiteInstance* instance) { | 1714 SiteInstance* instance) { |
1714 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); | 1715 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); |
1715 if (iter != proxy_hosts_.end()) { | 1716 if (iter != proxy_hosts_.end()) { |
1716 delete iter->second; | 1717 delete iter->second; |
1717 proxy_hosts_.erase(iter); | 1718 proxy_hosts_.erase(iter); |
1718 } | 1719 } |
1719 } | 1720 } |
1720 | 1721 |
1721 } // namespace content | 1722 } // namespace content |
OLD | NEW |