Index: content/browser/tab_contents/tab_contents.cc |
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc |
index 0b06b975200dce0dce4aec261d136bed54ff41aa..19a9e59c61bfac0d78916a36a348bbf29c13321f 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 |
jam
2011/08/15 15:59:10
ditto
|
+ // 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() { |