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

Unified Diff: content/renderer/history_controller.cc

Issue 1112823005: Ensure that HistoryController's current entry is updated on inert commits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format Created 5 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/renderer/history_controller.cc
diff --git a/content/renderer/history_controller.cc b/content/renderer/history_controller.cc
index 35f072ad78cf736ac7c15869f2871287f7e2f089..ad3485277b16dd7c9a612334316c58f48e73a2d0 100644
--- a/content/renderer/history_controller.cc
+++ b/content/renderer/history_controller.cc
@@ -169,6 +169,16 @@ void HistoryController::UpdateForCommit(RenderFrameImpl* frame,
CreateNewBackForwardItem(frame, item, navigation_within_page);
} else if (commit_type == blink::WebInitialCommitInChildFrame) {
UpdateForInitialLoadInChildFrame(frame, item);
+ } else {
Nate Chapin 2015/04/30 18:24:10 Now that this if-else block includes all WebHistor
Charlie Reis 2015/04/30 18:36:30 Done.
+ // Even for inert commits (e.g., location.replace, client redirects), make
+ // sure the current entry gets updated, if there is one.
+ DCHECK_EQ(blink::WebHistoryInertCommit, commit_type);
+ if (current_entry_) {
+ if (HistoryEntry::HistoryNode* node =
+ current_entry_->GetHistoryNodeForFrame(frame)) {
+ node->set_item(item);
+ }
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698