Chromium Code Reviews| 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); |