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

Unified Diff: content/renderer/history_controller.cc

Issue 2136873002: Clear child FrameNavigationEntries if a history navigation redirects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable test on PlzNavigate. Created 4 years, 5 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/renderer/history_controller.cc
diff --git a/content/renderer/history_controller.cc b/content/renderer/history_controller.cc
index 14ced356b8896426cd4f027aac3ff5c594a45e46..dbdb11214fe277781b5e8f3857baf8952152aab7 100644
--- a/content/renderer/history_controller.cc
+++ b/content/renderer/history_controller.cc
@@ -177,6 +177,13 @@ void HistoryController::UpdateForInitialLoadInChildFrame(
return;
if (HistoryEntry::HistoryNode* existing_node =
current_entry_->GetHistoryNodeForFrame(frame)) {
+ // Clear the children and any NavigationParams if this commit isn't for
+ // the same item. Otherwise we might have stale data after a redirect.
+ if (existing_node->item().itemSequenceNumber() !=
+ item.itemSequenceNumber()) {
+ existing_node->RemoveChildren();
+ navigation_params_.reset();
+ }
existing_node->set_item(item);
return;
}

Powered by Google App Engine
This is Rietveld 408576698