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

Unified Diff: content/renderer/history_controller.cc

Issue 1848103004: Fix HistoryEntry corruption when commit isn't for provisional entry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up Created 4 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/history_controller.cc
diff --git a/content/renderer/history_controller.cc b/content/renderer/history_controller.cc
index e459d9a3f7c1722f4ec68424c162ea9068c5cbf0..0a6cd634f3546944f4ee4dc7a8bdad8bc6a80168 100644
--- a/content/renderer/history_controller.cc
+++ b/content/renderer/history_controller.cc
@@ -187,7 +187,14 @@ void HistoryController::UpdateForCommit(RenderFrameImpl* frame,
case blink::WebBackForwardCommit:
if (!provisional_entry_)
return;
- current_entry_.reset(provisional_entry_.release());
+ // Commit the provisional entry, but only if this back/forward item
+ // matches it. Otherwise it could be a commit from an earlier attempt to
+ // go back/forward, and we should leave the provisional entry in place.
+ if (HistoryEntry::HistoryNode* node =
Nate Chapin 2016/04/01 17:33:51 In most cases, we'll end up looking up the node tw
Charlie Reis 2016/04/01 19:05:35 We can't early exit if the node is null. When the
+ provisional_entry_->GetHistoryNodeForFrame(frame)) {
+ if (node->item().itemSequenceNumber() == item.itemSequenceNumber())
Charlie Reis 2016/04/01 17:28:05 Is it safe to assume that a back/forward navigatio
+ current_entry_.reset(provisional_entry_.release());
+ }
if (HistoryEntry::HistoryNode* node =
current_entry_->GetHistoryNodeForFrame(frame)) {
node->set_item(item);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698