diff options
author | creis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-28 21:29:57 +0000 |
---|---|---|
committer | creis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-28 21:29:57 +0000 |
commit | a13cc36d904c699cd37f80a1c5200f21a7a54671 (patch) | |
tree | d3d7a62dd8858f9509b91127a0c3ae681699cc7e /content/browser | |
parent | d0fd9801d241358a8e17f190686ceaffd6f83fe5 (diff) | |
download | chromium_src-a13cc36d904c699cd37f80a1c5200f21a7a54671.zip chromium_src-a13cc36d904c699cd37f80a1c5200f21a7a54671.tar.gz chromium_src-a13cc36d904c699cd37f80a1c5200f21a7a54671.tar.bz2 |
Ensure restored NavigationEntries have a SiteInstance when they commit.
Before, renderer-initiated navigations to them would fail to update URL.
BUG=90653
TEST=SessionRestoreUITest.Restores*ForwardAndBackNavs
Review URL: http://codereview.chromium.org/7520012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94551 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
-rw-r--r-- | content/browser/tab_contents/tab_contents.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index fe1abaf..04a1198 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -1031,6 +1031,16 @@ void TabContents::OnGoToEntryAtOffset(int offset) { entry->set_transition_type(entry->transition_type() | PageTransition::FORWARD_BACK); NavigateToEntry(*entry, NavigationController::NO_RELOAD); + + // If the entry is being restored and doesn't have a SiteInstance yet, fill + // it in now that we know. This allows us to find the entry when it commits. + if (!entry->site_instance() && + entry->restore_type() != NavigationEntry::RESTORE_NONE) { + RenderViewHost* dest_rvh = render_manager_.pending_render_view_host() ? + render_manager_.pending_render_view_host() : + render_manager_.current_host(); + entry->set_site_instance(dest_rvh->site_instance()); + } } } |