Chromium Code Reviews| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1994 int proxy_routing_id) { | 1994 int proxy_routing_id) { |
| 1995 // Ensure the renderer process is initialized before creating the | 1995 // Ensure the renderer process is initialized before creating the |
| 1996 // RenderView. | 1996 // RenderView. |
| 1997 if (!render_view_host->GetProcess()->Init()) | 1997 if (!render_view_host->GetProcess()->Init()) |
| 1998 return false; | 1998 return false; |
| 1999 | 1999 |
| 2000 // We may have initialized this RenderViewHost for another RenderFrameHost. | 2000 // We may have initialized this RenderViewHost for another RenderFrameHost. |
| 2001 if (render_view_host->IsRenderViewLive()) | 2001 if (render_view_host->IsRenderViewLive()) |
| 2002 return true; | 2002 return true; |
| 2003 | 2003 |
| 2004 // If the ongoing navigation is to a WebUI and the RenderView is not in a | 2004 // If |render_view_host| is not for a proxy and the navigation is to a WebUI, |
| 2005 // guest process, tell the RenderViewHost about any bindings it will need | 2005 // and if the RenderView is not in a guest process, tell |render_view_host| |
| 2006 // enabled. | 2006 // about any bindings it will need enabled. |
| 2007 // TODO(carlosk): Move WebUI to RenderFrameHost in https://crbug.com/508850. | |
| 2007 WebUIImpl* dest_web_ui = nullptr; | 2008 WebUIImpl* dest_web_ui = nullptr; |
| 2008 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 2009 if (proxy_routing_id == MSG_ROUTING_NONE) { |
|
alexmos
2015/10/15 23:11:41
Just curious, would the proxy check be equivalent
Charlie Reis
2015/10/16 06:06:51
Good question. I added a DCHECK that they're equi
| |
| 2009 switches::kEnableBrowserSideNavigation)) { | 2010 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 2010 dest_web_ui = | 2011 switches::kEnableBrowserSideNavigation)) { |
| 2011 should_reuse_web_ui_ ? web_ui_.get() : speculative_web_ui_.get(); | 2012 dest_web_ui = |
| 2012 } else { | 2013 should_reuse_web_ui_ ? web_ui_.get() : speculative_web_ui_.get(); |
| 2013 dest_web_ui = pending_web_ui(); | 2014 } else { |
| 2015 dest_web_ui = pending_web_ui(); | |
| 2016 } | |
| 2014 } | 2017 } |
| 2015 if (dest_web_ui && !render_view_host->GetProcess()->IsForGuestsOnly()) { | 2018 if (dest_web_ui && !render_view_host->GetProcess()->IsForGuestsOnly()) { |
| 2016 render_view_host->AllowBindings(dest_web_ui->GetBindings()); | 2019 render_view_host->AllowBindings(dest_web_ui->GetBindings()); |
| 2017 } else { | 2020 } else { |
| 2018 // Ensure that we don't create an unprivileged RenderView in a WebUI-enabled | 2021 // Ensure that we don't create an unprivileged RenderView in a WebUI-enabled |
| 2019 // process unless it's swapped out. | 2022 // process unless it's swapped out. |
| 2020 if (render_view_host->is_active()) { | 2023 if (render_view_host->is_active()) { |
| 2021 CHECK(!ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( | 2024 CHECK(!ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( |
| 2022 render_view_host->GetProcess()->GetID())); | 2025 render_view_host->GetProcess()->GetID())); |
| 2023 } | 2026 } |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2638 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { | 2641 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { |
| 2639 if (!frame_tree_node_->opener()) | 2642 if (!frame_tree_node_->opener()) |
| 2640 return MSG_ROUTING_NONE; | 2643 return MSG_ROUTING_NONE; |
| 2641 | 2644 |
| 2642 return frame_tree_node_->opener() | 2645 return frame_tree_node_->opener() |
| 2643 ->render_manager() | 2646 ->render_manager() |
| 2644 ->GetRoutingIdForSiteInstance(instance); | 2647 ->GetRoutingIdForSiteInstance(instance); |
| 2645 } | 2648 } |
| 2646 | 2649 |
| 2647 } // namespace content | 2650 } // namespace content |
| OLD | NEW |