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/logging.h" | 10 #include "base/logging.h" |
(...skipping 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1606 | 1606 |
1607 bool RenderFrameHostManager::InitRenderView( | 1607 bool RenderFrameHostManager::InitRenderView( |
1608 RenderViewHostImpl* render_view_host, | 1608 RenderViewHostImpl* render_view_host, |
1609 int opener_route_id, | 1609 int opener_route_id, |
1610 int proxy_routing_id, | 1610 int proxy_routing_id, |
1611 bool for_main_frame_navigation) { | 1611 bool for_main_frame_navigation) { |
1612 // We may have initialized this RenderViewHost for another RenderFrameHost. | 1612 // We may have initialized this RenderViewHost for another RenderFrameHost. |
1613 if (render_view_host->IsRenderViewLive()) | 1613 if (render_view_host->IsRenderViewLive()) |
1614 return true; | 1614 return true; |
1615 | 1615 |
| 1616 // Ensure the renderer process is initialized before creating the |
| 1617 // RenderView. |
| 1618 if (!render_view_host->GetProcess()->Init()) |
| 1619 return false; |
| 1620 |
1616 // If the ongoing navigation is to a WebUI and the RenderView is not in a | 1621 // If the ongoing navigation is to a WebUI and the RenderView is not in a |
1617 // guest process, tell the RenderViewHost about any bindings it will need | 1622 // guest process, tell the RenderViewHost about any bindings it will need |
1618 // enabled. | 1623 // enabled. |
1619 WebUIImpl* dest_web_ui = nullptr; | 1624 WebUIImpl* dest_web_ui = nullptr; |
1620 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1625 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
1621 switches::kEnableBrowserSideNavigation)) { | 1626 switches::kEnableBrowserSideNavigation)) { |
1622 dest_web_ui = | 1627 dest_web_ui = |
1623 should_reuse_web_ui_ ? web_ui_.get() : speculative_web_ui_.get(); | 1628 should_reuse_web_ui_ ? web_ui_.get() : speculative_web_ui_.get(); |
1624 } else { | 1629 } else { |
1625 dest_web_ui = pending_web_ui(); | 1630 dest_web_ui = pending_web_ui(); |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2114 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 2119 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
2115 SiteInstance* instance) { | 2120 SiteInstance* instance) { |
2116 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); | 2121 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); |
2117 if (iter != proxy_hosts_.end()) { | 2122 if (iter != proxy_hosts_.end()) { |
2118 delete iter->second; | 2123 delete iter->second; |
2119 proxy_hosts_.erase(iter); | 2124 proxy_hosts_.erase(iter); |
2120 } | 2125 } |
2121 } | 2126 } |
2122 | 2127 |
2123 } // namespace content | 2128 } // namespace content |
OLD | NEW |