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

Unified Diff: content/browser/tab_contents/tab_contents.cc

Issue 7618016: Additional fixes for prerender/instant + browsing history. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Wrong signature Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
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() {

Powered by Google App Engine
This is Rietveld 408576698