diff options
Diffstat (limited to 'content/browser/tab_contents/tab_contents.cc')
-rw-r--r-- | content/browser/tab_contents/tab_contents.cc | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index 1fdccbf..b14a4cc 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -596,12 +596,29 @@ bool TabContents::NavigateToEntry( return true; } -void TabContents::SetHistoryLengthAndClear(int history_length) { +void TabContents::SetHistoryLengthAndPrune(const SiteInstance* site_instance, + int history_length, + int32 minimum_page_id) { + // SetHistoryLengthAndPrune doesn't handle pending cross-site navigations + // cleanly. Since it's only used when swapping in instant and prerendered + // TabContents, checks are done at a higher level to ensure that the pages + // are not swapped in during this case. + if (render_manager_.pending_render_view_host()) { + NOTREACHED(); + return; + } RenderViewHost* rvh = render_view_host(); - if (!rvh) + if (!rvh) { + NOTREACHED(); return; - rvh->Send(new ViewMsg_SetHistoryLengthAndClear(rvh->routing_id(), - history_length)); + } + if (site_instance && rvh->site_instance() != site_instance) { + NOTREACHED(); + return; + } + rvh->Send(new ViewMsg_SetHistoryLengthAndPrune(rvh->routing_id(), + history_length, + minimum_page_id)); } void TabContents::Stop() { |