Chromium Code Reviews| Index: content/browser/frame_host/navigator_impl.cc |
| diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc |
| index b005335680788b1666cb42c811ec3aec12de70f1..9ad1760294488e6f7a626d379fd6ddc49d65abee 100644 |
| --- a/content/browser/frame_host/navigator_impl.cc |
| +++ b/content/browser/frame_host/navigator_impl.cc |
| @@ -227,6 +227,22 @@ void NavigatorImpl::DidFailProvisionalLoadWithError( |
| controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); |
| } |
| + // If this failure came from a pending RenderFrameHost rather than the |
| + // current one, the current RenderFrameHost needs to be notified to stop |
| + // its load. Typically, the pending RenderFrameHost should be created only |
| + // once the browser process is sure that it will commit, but there is a case |
| + // where this is currently not true, which is when a cross-process frame is |
| + // blocked by X-Frame-Options or CSP frame-ancestors. This check will also |
| + // guard against any future such cases. |
| + // |
| + // TODO(mkwst, alexmos): The case above should disappear when X-Frame-Options |
| + // and CSP enforcement moves to the browser process |
| + // (https://crbug.com/555418). |
| + RenderFrameHostManager* manager = |
| + render_frame_host->frame_tree_node()->render_manager(); |
| + if (render_frame_host == manager->pending_frame_host()) |
|
alexmos
2016/02/25 21:59:12
Here, one case I was thinking about is if A embeds
Charlie Reis
2016/02/26 01:13:22
Right, the RFHM will destroy the RFH for B before
|
| + manager->current_frame_host()->Stop(); |
|
alexmos
2016/02/25 21:59:12
I did this more generically, as opposed to stoppin
alexmos
2016/02/25 21:59:12
Note also that I'm not cleaning up the pending RFH
Charlie Reis
2016/02/26 01:13:22
Camille, is RFHI::Stop() the right way to handle t
Charlie Reis
2016/02/26 01:13:22
Right. I'm sad to hear that there's still trouble
|
| + |
| if (delegate_) |
| delegate_->DidFailProvisionalLoadWithError(render_frame_host, params); |
| } |