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 d697e186d0c4dae004a901635c31d549514bffb9..3031266d732a1ac9b25e92012d1146e45bb228fe 100644 |
| --- a/content/browser/frame_host/render_frame_host_manager.cc |
| +++ b/content/browser/frame_host/render_frame_host_manager.cc |
| @@ -408,18 +408,18 @@ void RenderFrameHostManager::SwappedOutFrame( |
| return; |
| } |
| - // Sanity check that this is for the correct frame. |
| - DCHECK_EQ(render_frame_host_->GetRoutingID(), |
| - pending_nav_params_->render_frame_id); |
| - DCHECK_EQ(render_frame_host_->GetProcess()->GetID(), |
| - pending_nav_params_->global_request_id.child_id); |
| - |
| // Now that the unload handler has run, we need to either initiate the |
| // pending transfer (if there is one) or resume the paused response (if not). |
| // TODO(creis): The blank swapped out page is visible during this time, but |
| // we can shorten this by delivering the response directly, rather than |
| // forcing an identical request to be made. |
| if (pending_nav_params_->cross_site_transferring_request) { |
| + // Sanity check that this is for the correct frame. |
|
Charlie Reis
2014/03/21 23:24:33
This check only makes sense for transfers, not bro
|
| + DCHECK_EQ(render_frame_host_->GetRoutingID(), |
| + pending_nav_params_->render_frame_id); |
| + DCHECK_EQ(render_frame_host_->GetProcess()->GetID(), |
| + pending_nav_params_->global_request_id.child_id); |
| + |
| // Treat the last URL in the chain as the destination and the remainder as |
| // the redirect chain. |
| CHECK(pending_nav_params_->transfer_url_chain.size()); |
| @@ -1311,8 +1311,12 @@ RenderFrameHostImpl* RenderFrameHostManager::UpdateRendererStateForNavigate( |
| render_frame_host_->render_view_host()->Send(new ViewMsg_Stop( |
| render_frame_host_->render_view_host()->GetRoutingID())); |
| - pending_render_frame_host_->render_view_host()->SetNavigationsSuspended( |
| - true, base::TimeTicks()); |
| + // TODO(creis): Skip this for subframes until we can run beforeunload |
| + // handlers on them. |
| + if (frame_tree_node_->IsMainFrame()) { |
| + pending_render_frame_host_->render_view_host()->SetNavigationsSuspended( |
| + true, base::TimeTicks()); |
| + } |
| // Tell the CrossSiteRequestManager that this RVH has a pending cross-site |
| // request, so that ResourceDispatcherHost will know to tell us to run the |
| @@ -1330,7 +1334,8 @@ RenderFrameHostImpl* RenderFrameHostManager::UpdateRendererStateForNavigate( |
| // tell the old render view to run its beforeunload handler, since it |
| // doesn't otherwise know that the cross-site request is happening. This |
| // will trigger a call to OnBeforeUnloadACK with the reply. |
| - if (!is_transfer) |
| + // TODO(creis): Support beforeunload on subframes. |
| + if (!is_transfer && frame_tree_node_->IsMainFrame()) |
| render_frame_host_->DispatchBeforeUnload(true); |
| return pending_render_frame_host_.get(); |