diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-10 01:32:14 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-10 01:32:14 +0000 |
commit | 796931a919d669357b86b5989004d2099447b928 (patch) | |
tree | 5cb552694041500e4de7f99b82e767ce05c5871c /content/browser/tab_contents/navigation_controller.cc | |
parent | 04dd0d690d0992bba0cc656da4e49d024b1700d6 (diff) | |
download | chromium_src-796931a919d669357b86b5989004d2099447b928.zip chromium_src-796931a919d669357b86b5989004d2099447b928.tar.gz chromium_src-796931a919d669357b86b5989004d2099447b928.tar.bz2 |
A fairly recent change introduced a history of page_ids for each RenderView, to validate that Navigation's go to legitimate pages.
In the prerender and instant cases, the history of page_id's was not accurate, because it was not offset to reflect the point in time when the page was swapped in. For example, if the history for the tab looks like
about:blank
http://www.launchprerender.com/
http://www.prerendered_page.com/first_page.html
http://www.prerendered_page.com/second_page.html
The history of page_id's in the prerender-page RenderView should look like
[-1, -1, 13, 14] - with the first two entries being -1 since they are not captured in this render view.
Before this fix, it would look like
[13, 14] - and when the back navigation was attempted, the length was not as long as expected.
BUG=89798
TEST=Go to prerender_test.appspot.com, do a prerender on dev.chromium.org, click on a link within dev.chromium.org, press back and see that it works instead of spinning forever. Also, browser_tests --gtest_filter=*BackToPrerenderedPage, which fails without the change.
Review URL: http://codereview.chromium.org/7491096
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96109 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/tab_contents/navigation_controller.cc')
-rw-r--r-- | content/browser/tab_contents/navigation_controller.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/content/browser/tab_contents/navigation_controller.cc b/content/browser/tab_contents/navigation_controller.cc index e29ecc3..0144fef 100644 --- a/content/browser/tab_contents/navigation_controller.cc +++ b/content/browser/tab_contents/navigation_controller.cc @@ -931,6 +931,9 @@ void NavigationController::CopyStateFromAndPrune(NavigationController* source, if (last_committed_entry_index_ != -1) last_committed_entry_index_--; } + + // Update the history in the RenderView. + tab_contents_->SetHistoryLengthAndClear(max_source_index); } void NavigationController::PruneAllButActive() { |