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

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

Issue 1519943002: Shortcut cross-process frame transfers to avoid pending NavigationEntries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove dead param Created 5 years 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 | « no previous file | content/browser/cross_site_transfer_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_contents.cc
diff --git a/chrome/browser/prerender/prerender_contents.cc b/chrome/browser/prerender/prerender_contents.cc
index 2991013769160c746419f952aa4e60ae31b2f7c2..2b311ed4c0f934ac2700deb9a915ff93496022aa 100644
--- a/chrome/browser/prerender/prerender_contents.cc
+++ b/chrome/browser/prerender/prerender_contents.cc
@@ -92,15 +92,21 @@ class PrerenderContents::WebContentsDelegateImpl
const OpenURLParams& params) override {
// |OpenURLFromTab| is typically called when a frame performs a navigation
// that requires the browser to perform the transition instead of WebKit.
- // Examples include prerendering a site that redirects to an app URL, or if
- // --site-per-process is specified and the prerendered frame redirects to a
- // different origin.
+ // Examples include client redirects to hosted app URLs.
// TODO(cbentzel): Consider supporting this for CURRENT_TAB dispositions, if
// it is a common case during prerenders.
prerender_contents_->Destroy(FINAL_STATUS_OPEN_URL);
return NULL;
}
+ bool ShouldTransferNavigation() override {
+ // Cancel the prerender if the navigation attempts to transfer to a
+ // different process. Examples include server redirects to privileged pages
+ // or cross-site subframe navigations in --site-per-process.
+ prerender_contents_->Destroy(FINAL_STATUS_OPEN_URL);
+ return false;
+ }
+
void CloseContents(content::WebContents* contents) override {
prerender_contents_->Destroy(FINAL_STATUS_CLOSED);
}
« no previous file with comments | « no previous file | content/browser/cross_site_transfer_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698