| 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 // compare against the main frame's URL, since that may have changed due | 246 // compare against the main frame's URL, since that may have changed due |
| 247 // to a replaceState. (Even origin can change on replaceState in certain | 247 // to a replaceState. (Even origin can change on replaceState in certain |
| 248 // modes.) | 248 // modes.) |
| 249 // | 249 // |
| 250 // It would be safe to additionally check the ISNs of all parent frames | 250 // It would be safe to additionally check the ISNs of all parent frames |
| 251 // (and not just the root), but that is less critical because it won't | 251 // (and not just the root), but that is less critical because it won't |
| 252 // lead to a URL spoof. | 252 // lead to a URL spoof. |
| 253 if (frame->IsMainFrame() || | 253 if (frame->IsMainFrame() || |
| 254 current_entry_->root().itemSequenceNumber() == | 254 current_entry_->root().itemSequenceNumber() == |
| 255 provisional_entry_->root().itemSequenceNumber()) { | 255 provisional_entry_->root().itemSequenceNumber()) { |
| 256 current_entry_.reset(provisional_entry_.release()); | 256 current_entry_ = std::move(provisional_entry_); |
| 257 } | 257 } |
| 258 | 258 |
| 259 // We're guaranteed to have a current entry now. | 259 // We're guaranteed to have a current entry now. |
| 260 DCHECK(current_entry_); | 260 DCHECK(current_entry_); |
| 261 | 261 |
| 262 if (HistoryEntry::HistoryNode* node = | 262 if (HistoryEntry::HistoryNode* node = |
| 263 current_entry_->GetHistoryNodeForFrame(frame)) { | 263 current_entry_->GetHistoryNodeForFrame(frame)) { |
| 264 // Clear the children and any NavigationParams if this commit isn't for | 264 // Clear the children and any NavigationParams if this commit isn't for |
| 265 // the same item. Otherwise we might have stale data from a race. | 265 // the same item. Otherwise we might have stale data from a race. |
| 266 if (node->item().itemSequenceNumber() != item.itemSequenceNumber()) { | 266 if (node->item().itemSequenceNumber() != item.itemSequenceNumber()) { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 bool clone_children_of_target) { | 326 bool clone_children_of_target) { |
| 327 if (!current_entry_) { | 327 if (!current_entry_) { |
| 328 current_entry_.reset(new HistoryEntry(new_item)); | 328 current_entry_.reset(new HistoryEntry(new_item)); |
| 329 } else { | 329 } else { |
| 330 current_entry_.reset(current_entry_->CloneAndReplace( | 330 current_entry_.reset(current_entry_->CloneAndReplace( |
| 331 new_item, clone_children_of_target, target_frame, render_view_)); | 331 new_item, clone_children_of_target, target_frame, render_view_)); |
| 332 } | 332 } |
| 333 } | 333 } |
| 334 | 334 |
| 335 } // namespace content | 335 } // namespace content |
| OLD | NEW |