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

Side by Side Diff: content/browser/frame_host/navigation_controller_impl.cc

Issue 1010243002: PlzNavigate: Properly set the pending entry in the NavigatorImpl unit test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
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 #include "content/browser/frame_host/navigation_controller_impl.h" 5 #include "content/browser/frame_host/navigation_controller_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 1742 matching lines...) Expand 10 before | Expand all | Expand 10 after
1753 // when the tab is being destroyed for shutdown, since it won't return to 1753 // when the tab is being destroyed for shutdown, since it won't return to
1754 // NavigateToEntry in that case.) http://crbug.com/347742. 1754 // NavigateToEntry in that case.) http://crbug.com/347742.
1755 CHECK(!in_navigate_to_pending_entry_ || delegate_->IsBeingDestroyed()); 1755 CHECK(!in_navigate_to_pending_entry_ || delegate_->IsBeingDestroyed());
1756 1756
1757 if (pending_entry_index_ == -1) 1757 if (pending_entry_index_ == -1)
1758 delete pending_entry_; 1758 delete pending_entry_;
1759 pending_entry_ = NULL; 1759 pending_entry_ = NULL;
1760 pending_entry_index_ = -1; 1760 pending_entry_index_ = -1;
1761 } 1761 }
1762 1762
1763 void NavigationControllerImpl::SetPendingEntryAndIndexForTesting(int index) {
1764 pending_entry_index_ = index;
1765 pending_entry_ = entries_[pending_entry_index_].get();
1766 }
1767
1763 void NavigationControllerImpl::DiscardTransientEntry() { 1768 void NavigationControllerImpl::DiscardTransientEntry() {
1764 if (transient_entry_index_ == -1) 1769 if (transient_entry_index_ == -1)
1765 return; 1770 return;
1766 entries_.erase(entries_.begin() + transient_entry_index_); 1771 entries_.erase(entries_.begin() + transient_entry_index_);
1767 if (last_committed_entry_index_ > transient_entry_index_) 1772 if (last_committed_entry_index_ > transient_entry_index_)
1768 last_committed_entry_index_--; 1773 last_committed_entry_index_--;
1769 transient_entry_index_ = -1; 1774 transient_entry_index_ = -1;
1770 } 1775 }
1771 1776
1772 int NavigationControllerImpl::GetEntryIndexWithPageID( 1777 int NavigationControllerImpl::GetEntryIndexWithPageID(
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1815 } 1820 }
1816 } 1821 }
1817 } 1822 }
1818 1823
1819 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 1824 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
1820 const base::Callback<base::Time()>& get_timestamp_callback) { 1825 const base::Callback<base::Time()>& get_timestamp_callback) {
1821 get_timestamp_callback_ = get_timestamp_callback; 1826 get_timestamp_callback_ = get_timestamp_callback;
1822 } 1827 }
1823 1828
1824 } // namespace content 1829 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698