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 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1001 // If the pending navigation is to a WebUI and the RenderView is not in a | 1001 // If the pending navigation is to a WebUI and the RenderView is not in a |
1002 // guest process, tell the RenderViewHost about any bindings it will need | 1002 // guest process, tell the RenderViewHost about any bindings it will need |
1003 // enabled. | 1003 // enabled. |
1004 if (pending_web_ui() && !render_view_host->GetProcess()->IsGuest()) { | 1004 if (pending_web_ui() && !render_view_host->GetProcess()->IsGuest()) { |
1005 render_view_host->AllowBindings(pending_web_ui()->GetBindings()); | 1005 render_view_host->AllowBindings(pending_web_ui()->GetBindings()); |
1006 } else { | 1006 } else { |
1007 // Ensure that we don't create an unprivileged RenderView in a WebUI-enabled | 1007 // Ensure that we don't create an unprivileged RenderView in a WebUI-enabled |
1008 // process unless it's swapped out. | 1008 // process unless it's swapped out. |
1009 RenderViewHostImpl* rvh_impl = | 1009 RenderViewHostImpl* rvh_impl = |
1010 static_cast<RenderViewHostImpl*>(render_view_host); | 1010 static_cast<RenderViewHostImpl*>(render_view_host); |
1011 if (!rvh_impl->IsSwappedOut()) { | 1011 // In single-process mode, we are forced to create all render views in |
1012 // the same single process. | |
1013 bool single_process = | |
1014 CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess); | |
nasko
2014/05/27 14:06:09
It will be better to use RenderProcessHost::run_re
Krzysztof Olczyk
2014/05/28 09:12:50
Done.
| |
1015 if (!rvh_impl->IsSwappedOut() && !single_process) { | |
1012 CHECK(!ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( | 1016 CHECK(!ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( |
1013 render_view_host->GetProcess()->GetID())); | 1017 render_view_host->GetProcess()->GetID())); |
1014 } | 1018 } |
1015 } | 1019 } |
1016 | 1020 |
1017 return delegate_->CreateRenderViewForRenderManager( | 1021 return delegate_->CreateRenderViewForRenderManager( |
1018 render_view_host, opener_route_id, proxy_routing_id, for_main_frame); | 1022 render_view_host, opener_route_id, proxy_routing_id, for_main_frame); |
1019 } | 1023 } |
1020 | 1024 |
1021 void RenderFrameHostManager::CommitPending() { | 1025 void RenderFrameHostManager::CommitPending() { |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1470 SiteInstance* instance) const { | 1474 SiteInstance* instance) const { |
1471 RenderFrameProxyHostMap::const_iterator iter = | 1475 RenderFrameProxyHostMap::const_iterator iter = |
1472 proxy_hosts_.find(instance->GetId()); | 1476 proxy_hosts_.find(instance->GetId()); |
1473 if (iter != proxy_hosts_.end()) | 1477 if (iter != proxy_hosts_.end()) |
1474 return iter->second; | 1478 return iter->second; |
1475 | 1479 |
1476 return NULL; | 1480 return NULL; |
1477 } | 1481 } |
1478 | 1482 |
1479 } // namespace content | 1483 } // namespace content |
OLD | NEW |