| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /* | 5 /* |
| 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * | 10 * |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 void HistoryController::RecursiveGoToEntry( | 129 void HistoryController::RecursiveGoToEntry( |
| 130 WebFrame* frame, | 130 WebFrame* frame, |
| 131 HistoryFrameLoadVector& same_document_loads, | 131 HistoryFrameLoadVector& same_document_loads, |
| 132 HistoryFrameLoadVector& different_document_loads) { | 132 HistoryFrameLoadVector& different_document_loads) { |
| 133 DCHECK(provisional_entry_); | 133 DCHECK(provisional_entry_); |
| 134 DCHECK(current_entry_); | 134 DCHECK(current_entry_); |
| 135 RenderFrameImpl* render_frame = RenderFrameImpl::FromWebFrame(frame); | 135 RenderFrameImpl* render_frame = RenderFrameImpl::FromWebFrame(frame); |
| 136 const WebHistoryItem& new_item = | 136 const WebHistoryItem& new_item = |
| 137 provisional_entry_->GetItemForFrame(render_frame); | 137 provisional_entry_->GetItemForFrame(render_frame); |
| 138 const WebHistoryItem& old_item = | 138 |
| 139 current_entry_->GetItemForFrame(render_frame); | 139 // Use the last committed history item for the frame rather than |
| 140 // current_entry_, since the latter may not accurately reflect which URL is |
| 141 // currently committed in the frame. See https://crbug.com/612713#c12. |
| 142 const WebHistoryItem& old_item = render_frame->current_history_item(); |
| 143 |
| 140 if (new_item.isNull()) | 144 if (new_item.isNull()) |
| 141 return; | 145 return; |
| 142 | 146 |
| 143 if (old_item.isNull() || | 147 if (old_item.isNull() || |
| 144 new_item.itemSequenceNumber() != old_item.itemSequenceNumber()) { | 148 new_item.itemSequenceNumber() != old_item.itemSequenceNumber()) { |
| 145 if (!old_item.isNull() && | 149 if (!old_item.isNull() && |
| 146 new_item.documentSequenceNumber() == | 150 new_item.documentSequenceNumber() == |
| 147 old_item.documentSequenceNumber()) { | 151 old_item.documentSequenceNumber()) { |
| 148 same_document_loads.push_back(std::make_pair(frame, new_item)); | 152 same_document_loads.push_back(std::make_pair(frame, new_item)); |
| 149 | 153 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 bool clone_children_of_target) { | 288 bool clone_children_of_target) { |
| 285 if (!current_entry_) { | 289 if (!current_entry_) { |
| 286 current_entry_.reset(new HistoryEntry(new_item)); | 290 current_entry_.reset(new HistoryEntry(new_item)); |
| 287 } else { | 291 } else { |
| 288 current_entry_.reset(current_entry_->CloneAndReplace( | 292 current_entry_.reset(current_entry_->CloneAndReplace( |
| 289 new_item, clone_children_of_target, target_frame, render_view_)); | 293 new_item, clone_children_of_target, target_frame, render_view_)); |
| 290 } | 294 } |
| 291 } | 295 } |
| 292 | 296 |
| 293 } // namespace content | 297 } // namespace content |
| OLD | NEW |