| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1681 // need to keep continuity with the pending entry, so copy the pending entry's | 1681 // need to keep continuity with the pending entry, so copy the pending entry's |
| 1682 // unique ID to the committed entry. If the pending_entry_index_ isn't -1, | 1682 // unique ID to the committed entry. If the pending_entry_index_ isn't -1, |
| 1683 // then the renderer navigated on its own, independent of the pending entry, | 1683 // then the renderer navigated on its own, independent of the pending entry, |
| 1684 // so don't copy anything. | 1684 // so don't copy anything. |
| 1685 if (pending_entry_ && pending_entry_index_ == -1) | 1685 if (pending_entry_ && pending_entry_index_ == -1) |
| 1686 entry->set_unique_id(pending_entry_->GetUniqueID()); | 1686 entry->set_unique_id(pending_entry_->GetUniqueID()); |
| 1687 | 1687 |
| 1688 DiscardNonCommittedEntriesInternal(); | 1688 DiscardNonCommittedEntriesInternal(); |
| 1689 | 1689 |
| 1690 int current_size = static_cast<int>(entries_.size()); | 1690 int current_size = static_cast<int>(entries_.size()); |
| 1691 DCHECK_IMPLIES(replace, current_size > 0); | 1691 DCHECK(!replace || (current_size > 0)); |
| 1692 | 1692 |
| 1693 if (current_size > 0) { | 1693 if (current_size > 0) { |
| 1694 // Prune any entries which are in front of the current entry. | 1694 // Prune any entries which are in front of the current entry. |
| 1695 // Also prune the current entry if we are to replace the current entry. | 1695 // Also prune the current entry if we are to replace the current entry. |
| 1696 // last_committed_entry_index_ must be updated here since calls to | 1696 // last_committed_entry_index_ must be updated here since calls to |
| 1697 // NotifyPrunedEntries() below may re-enter and we must make sure | 1697 // NotifyPrunedEntries() below may re-enter and we must make sure |
| 1698 // last_committed_entry_index_ is not left in an invalid state. | 1698 // last_committed_entry_index_ is not left in an invalid state. |
| 1699 if (replace) | 1699 if (replace) |
| 1700 --last_committed_entry_index_; | 1700 --last_committed_entry_index_; |
| 1701 | 1701 |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2034 } | 2034 } |
| 2035 } | 2035 } |
| 2036 } | 2036 } |
| 2037 | 2037 |
| 2038 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 2038 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
| 2039 const base::Callback<base::Time()>& get_timestamp_callback) { | 2039 const base::Callback<base::Time()>& get_timestamp_callback) { |
| 2040 get_timestamp_callback_ = get_timestamp_callback; | 2040 get_timestamp_callback_ = get_timestamp_callback; |
| 2041 } | 2041 } |
| 2042 | 2042 |
| 2043 } // namespace content | 2043 } // namespace content |
| OLD | NEW |