Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Unified Diff: content/browser/frame_host/navigator_impl.cc

Issue 1710283003: OOPIF: Handle cross-site frames being blocked by X-Frame-Options or CSP. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split off the relaxed DCHECK in OnCrossSiteResponse into separate CL Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6d63a274159f87f415bc02e76195d8e4c15d49f3..83033ab32dff3ab3b0b776968659cf6926bb6a3d 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())
+ manager->current_frame_host()->Stop();
+
if (delegate_)
delegate_->DidFailProvisionalLoadWithError(render_frame_host, params);
}
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698