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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 // Note: we don't call InitRenderView here because we are navigating away | 179 // Note: we don't call InitRenderView here because we are navigating away |
180 // soon anyway, and we don't have the NavigationEntry for this host. | 180 // soon anyway, and we don't have the NavigationEntry for this host. |
181 delegate_->CreateRenderViewForRenderManager( | 181 delegate_->CreateRenderViewForRenderManager( |
182 render_frame_host_->render_view_host(), MSG_ROUTING_NONE, | 182 render_frame_host_->render_view_host(), MSG_ROUTING_NONE, |
183 MSG_ROUTING_NONE, frame_tree_node_->IsMainFrame()); | 183 MSG_ROUTING_NONE, frame_tree_node_->IsMainFrame()); |
184 } | 184 } |
185 | 185 |
186 // If the renderer crashed, then try to create a new one to satisfy this | 186 // If the renderer crashed, then try to create a new one to satisfy this |
187 // navigation request. | 187 // navigation request. |
188 if (!dest_render_frame_host->IsRenderFrameLive()) { | 188 if (!dest_render_frame_host->IsRenderFrameLive()) { |
| 189 // Instruct the destination render frame host to set up a Mojo connection |
| 190 // with the new render frame if necessary. Note that this call needs to |
| 191 // occur before initializing the RenderView; the flow of creating the |
| 192 // RenderView can cause browser-side code to execute that expects the this |
| 193 // RFH's ServiceRegistry to be initialized (e.g., if the site is a WebUI |
| 194 // site that is handled via Mojo, then Mojo WebUI code in //chrome will |
| 195 // add a service to this RFH's ServiceRegistry). |
| 196 dest_render_frame_host->SetUpMojoIfNeeded(); |
| 197 |
189 // Recreate the opener chain. | 198 // Recreate the opener chain. |
190 int opener_route_id = delegate_->CreateOpenerRenderViewsForRenderManager( | 199 int opener_route_id = delegate_->CreateOpenerRenderViewsForRenderManager( |
191 dest_render_frame_host->GetSiteInstance()); | 200 dest_render_frame_host->GetSiteInstance()); |
192 if (!InitRenderView(dest_render_frame_host->render_view_host(), | 201 if (!InitRenderView(dest_render_frame_host->render_view_host(), |
193 opener_route_id, | 202 opener_route_id, |
194 MSG_ROUTING_NONE, | 203 MSG_ROUTING_NONE, |
195 frame_tree_node_->IsMainFrame())) | 204 frame_tree_node_->IsMainFrame())) |
196 return NULL; | 205 return NULL; |
197 | 206 |
198 // Now that we've created a new renderer, be sure to hide it if it isn't | 207 // Now that we've created a new renderer, be sure to hide it if it isn't |
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1607 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 1616 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
1608 SiteInstance* instance) { | 1617 SiteInstance* instance) { |
1609 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); | 1618 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); |
1610 if (iter != proxy_hosts_.end()) { | 1619 if (iter != proxy_hosts_.end()) { |
1611 delete iter->second; | 1620 delete iter->second; |
1612 proxy_hosts_.erase(iter); | 1621 proxy_hosts_.erase(iter); |
1613 } | 1622 } |
1614 } | 1623 } |
1615 | 1624 |
1616 } // namespace content | 1625 } // namespace content |
OLD | NEW |