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

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

Issue 2656653002: Suppress NEW_NAVIGATION_ENTRY prerenderer failures for ORIGIN_OFFLINE (Closed)
Patch Set: Simple cancel any subresources with unsupported schemes and continue for Offline requests Created 3 years, 11 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: chrome/browser/prerender/prerender_contents.cc
diff --git a/chrome/browser/prerender/prerender_contents.cc b/chrome/browser/prerender/prerender_contents.cc
index aea147d28bf082ac2336cfc8edae770afc03b79b..cbff0385294322601e199fbe9870a6da86487605 100644
--- a/chrome/browser/prerender/prerender_contents.cc
+++ b/chrome/browser/prerender/prerender_contents.cc
@@ -577,6 +577,13 @@ void PrerenderContents::DidFinishLoad(
void PrerenderContents::DidNavigateMainFrame(
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) {
+ // Prevent ORIGIN_OFFLINE prerenders from being destroyed on location.href
+ // change, since the history is never merged for offline prerenders. Also
+ // avoid adding aliases as they may potentially mark other valid requests to
+ // offline as duplicate.
+ if (origin() == ORIGIN_OFFLINE)
+ return;
+
// If the prerender made a second navigation entry, abort the prerender. This
// avoids having to correctly implement a complex history merging case (this
// interacts with location.replace) and correctly synchronize with the
« no previous file with comments | « chrome/browser/prerender/prerender_browsertest.cc ('k') | chrome/browser/prerender/prerender_resource_throttle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698