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

Unified Diff: chrome/browser/prerender/prerender_manager.cc

Issue 15041004: Replace PruneAllButActive with PruneAllButVisible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change to CHECK. Created 7 years, 7 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
« no previous file with comments | « chrome/browser/prerender/prerender_browsertest.cc ('k') | chrome/browser/ui/browser_commands.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_manager.cc
diff --git a/chrome/browser/prerender/prerender_manager.cc b/chrome/browser/prerender/prerender_manager.cc
index 3ead07f66ed0987a4809522fb4cf419f844ce887..56ef34ee50d96fffdbc83262fa2e4640dc69ec10 100644
--- a/chrome/browser/prerender/prerender_manager.cc
+++ b/chrome/browser/prerender/prerender_manager.cc
@@ -421,6 +421,14 @@ bool PrerenderManager::MaybeUsePrerenderedPage(WebContents* web_contents,
prerender_data->contents()->prerender_contents()) {
if (web_contents == new_web_contents)
return false; // Do not swap in to ourself.
+
+ // We cannot swap in if there is no last committed entry, because we would
+ // show a blank page under an existing entry from the current tab. Even if
+ // there is a pending entry, it may not commit.
+ // TODO(creis): If there is a pending navigation and no last committed
+ // entry, we might be able to transfer the network request instead.
+ if (!new_web_contents->GetController().CanPruneAllButVisible())
+ return false;
}
// Do not use the prerendered version if there is an opener object.
« no previous file with comments | « chrome/browser/prerender/prerender_browsertest.cc ('k') | chrome/browser/ui/browser_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698