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

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

Issue 1134193003: Avoid renderer kills on subframe navigations after main frame replaceState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/navigation_controller_impl_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_controller_impl.cc
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index 08555a3f9c5714cf6bfab46bbce3a8887d95cdc7..95f5f1307ea128f556e65da57d8f69fadc7b4396 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -1456,10 +1456,11 @@ bool NavigationControllerImpl::RendererDidNavigateAutoSubframe(
// Update the current navigation entry in case we're going back/forward.
if (entry_index != last_committed_entry_index_) {
- // Make sure that a subframe commit isn't changing the main frame URL.
+ // Make sure that a subframe commit isn't changing the main frame's origin.
// Otherwise the renderer process may be confused, leading to a URL spoof.
- if (GetLastCommittedEntry()->GetURL() !=
- GetEntryAtIndex(entry_index)->GetURL()) {
+ // We can't check the path since that may change (https://crbug.com/373041).
+ if (GetLastCommittedEntry()->GetURL().GetOrigin() !=
+ GetEntryAtIndex(entry_index)->GetURL().GetOrigin()) {
bad_message::ReceivedBadMessage(rfh->GetProcess(),
bad_message::NC_AUTO_SUBFRAME);
}
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_controller_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698