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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2439903003: PlzNavigate: Allow frames to fallback to alternative content. (Closed)
Patch Set: Using frameloader::loadFail. Created 4 years, 1 month 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/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 06eba94a764b63205987137d32bc4b980f61c73a..de1d292ad83319b26462ab7ea8ea82e97261cc8a 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -5071,6 +5071,15 @@ void RenderFrameImpl::OnFailedNavigation(
return;
}
+ // On load failure, a frame can ask its owner to render fallback content.
+ // If it is possible, there is no more need to load an error page since it
+ // will not be displayed.
+ if (frame_->canRenderFallbackContent()) {
+ frame_->loadFailed(error);
+ browser_side_navigation_pending_ = false;
+ return;
+ }
+
// Make sure errors are not shown in view source mode.
frame_->enableViewSourceMode(false);

Powered by Google App Engine
This is Rietveld 408576698