Chromium Code Reviews| Index: content/browser/frame_host/render_frame_host_manager.cc |
| diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc |
| index ade1c727557460c9530d29d25de9da32dfcf1343..dc3974896cd39d4aa33a5a8bef3ddb8ab09c8797 100644 |
| --- a/content/browser/frame_host/render_frame_host_manager.cc |
| +++ b/content/browser/frame_host/render_frame_host_manager.cc |
| @@ -525,10 +525,17 @@ void RenderFrameHostManager::SwapOutOldPage() { |
| // to resume. |
| // Note: This must be done on the RFH or else we'll swap out the top-level |
| // page when subframes navigate. |
| - if (frame_tree_node_->IsMainFrame()) |
| + if (frame_tree_node_->IsMainFrame()) { |
| render_frame_host_->render_view_host()->SwapOut(); |
| - else |
| + } else { |
| + // The RenderFrameHost being swapped out becomes the proxy for this |
| + // frame in its parent's process. |
|
Charlie Reis
2014/02/04 20:11:12
I think there's something more to explain in this
kenrb
2014/02/04 21:45:03
Done. Please check if the new comment makes sense
Charlie Reis
2014/02/04 21:52:41
Thanks, that's much better.
|
| + // TODO(kenrb): This will change when RenderFrameProxyHost is created. |
| + if (!cross_process_frame_connector_) |
|
Charlie Reis
2014/02/04 20:11:12
Style nit: Needs braces.
kenrb
2014/02/04 21:45:03
Done.
|
| + cross_process_frame_connector_ = |
| + new CrossProcessFrameConnector(render_frame_host_); |
| render_frame_host_->SwapOut(); |
| + } |
| // ResourceDispatcherHost has told us to run the onunload handler, which |
| // means it is not a download or unsafe page, and we are going to perform the |
| @@ -896,20 +903,6 @@ int RenderFrameHostManager::CreateRenderFrame( |
| new_render_frame_host = CreateRenderFrameHost(instance, MSG_ROUTING_NONE, |
| MSG_ROUTING_NONE, swapped_out, |
| hidden); |
| - if (parent_node && !cross_process_frame_connector_) { |
| - // The proxy RenderFrameHost to the parent process is either the current |
| - // RenderFrameHost, or it has been added to the swapped out list. |
| - // TODO(kenrb): This will change when RenderFrameProxyHost is created. |
| - RenderFrameHostImpl* proxy_to_parent = render_frame_host_; |
| - if (render_frame_host_->render_view_host()->GetSiteInstance() != |
| - parent_node->render_manager()->current_host()->GetSiteInstance()) { |
| - GetSwappedOutRenderFrameHost( |
| - parent_node->render_manager()->current_host()->GetSiteInstance()); |
| - } |
| - CHECK(proxy_to_parent); |
| - cross_process_frame_connector_ = |
| - new CrossProcessFrameConnector(proxy_to_parent); |
| - } |
| // If the new RFH is swapped out already, store it. Otherwise prevent the |
| // process from exiting while we're trying to navigate in it. |