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

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

Issue 1816763002: OOPIF: Fix subframe back/forward after recreating FTNs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix review comments Created 4 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
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 6732fefb8c17d6238449212d5b06b4a38c78dabd..a94e5381a08ea1cd872d656e4911f5f5286ea9bd 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -736,7 +736,7 @@ void NavigationControllerImpl::LoadURLWithParams(const LoadURLParams& params) {
if (SiteIsolationPolicy::UseSubframeNavigationEntries()) {
entry = GetLastCommittedEntry()->Clone();
entry->SetPageID(-1);
- entry->AddOrUpdateFrameEntry(node, "", -1, -1, nullptr, params.url,
+ entry->AddOrUpdateFrameEntry(node, -1, -1, nullptr, params.url,
params.referrer, PageState());
}
}
@@ -977,7 +977,7 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
// NavigationEntry.
// TODO(creis): Have the renderer classify location.replace as
// did_create_new_entry for all cases and eliminate this special case. This
- // requires updating several test expectations. See https://crbug.com/317872.
+ // requires updating several test expectations. See https://crbug.com/596707.
if (!rfh->GetParent() && GetLastCommittedEntry() &&
GetLastCommittedEntry()->site_instance() != rfh->GetSiteInstance() &&
params.should_replace_current_entry) {
@@ -1184,6 +1184,15 @@ void NavigationControllerImpl::RendererDidNavigateToExistingPage(
if (entry->update_virtual_url_with_url())
UpdateVirtualURLToURL(entry, params.url);
+ // Update the ISN and DSN in case this was a location.replace, which can cause
+ // them to change.
+ // TODO(creis): Classify location.replace as NEW_PAGE instead of EXISTING_PAGE
+ // in https://crbug.com/596707.
+ FrameNavigationEntry* frame_entry =
+ entry->GetFrameEntry(rfh->frame_tree_node());
+ frame_entry->set_item_sequence_number(params.item_sequence_number);
+ frame_entry->set_document_sequence_number(params.document_sequence_number);
+
// The redirected to page should not inherit the favicon from the previous
// page.
if (ui::PageTransitionIsRedirect(params.transition))
@@ -1326,9 +1335,9 @@ bool NavigationControllerImpl::RendererDidNavigateAutoSubframe(
// it may be a "history auto" case where we update an existing one.
NavigationEntryImpl* last_committed = GetLastCommittedEntry();
last_committed->AddOrUpdateFrameEntry(
- rfh->frame_tree_node(), params.frame_unique_name,
- params.item_sequence_number, params.document_sequence_number,
- rfh->GetSiteInstance(), params.url, params.referrer, params.page_state);
+ rfh->frame_tree_node(), params.item_sequence_number,
+ params.document_sequence_number, rfh->GetSiteInstance(), params.url,
+ params.referrer, params.page_state);
// Cross-process subframe navigations may leave a pending entry around.
// Clear it if it's actually for the subframe.

Powered by Google App Engine
This is Rietveld 408576698