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

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

Issue 2815413002: Relax self-referential frame checks for non-initial navigations. (Closed)
Patch Set: Created 3 years, 8 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_manager_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_handle_impl.cc
diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc
index 46866467c1b8cdbff04a4724cd1a56569396b7e6..ea15872bb81478197ea7cea00d3aee278d85abd4 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -975,6 +975,15 @@ bool NavigationHandleImpl::IsSelfReferentialURL() {
if (!is_renderer_initiated_)
return false;
+ // Only enforce this for initial navigations in frames. This handles
+ // the common cases of developers shooting themselves in the foot, but allows
+ // frames to deliberately navigate themselves to a self-referential URL
+ // after being created. For example, some sites construct frame hierarchies
+ // with frames that navigate to the same URL via POSTs. See
+ // https://crbug.com/710008.
+ if (frame_tree_node_->has_committed_real_load())
+ return false;
+
// We allow one level of self-reference because some sites depend on that,
// but we don't allow more than one.
bool found_self_reference = false;
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698