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

Unified Diff: content/browser/frame_host/navigator_impl.cc

Issue 958083002: PlzNavigate: Show error pages when the navigation failed before commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@support-data-urls
Patch Set: Updated test Created 5 years, 8 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 | « content/browser/frame_host/navigator_impl.h ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 527eda7d6c833688a45331a6b1d1c5ee40d9771b..fd59de25c324c7bebe2e9f46604ce172cc70f7e5 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -723,6 +723,29 @@ void NavigatorImpl::CommitNavigation(FrameTreeNode* frame_tree_node,
}
// PlzNavigate
+void NavigatorImpl::FailedNavigation(FrameTreeNode* frame_tree_node,
+ bool has_stale_copy_in_cache,
+ int error_code) {
+ CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableBrowserSideNavigation));
+
+ NavigationRequest* navigation_request =
+ navigation_request_map_.get(frame_tree_node->frame_tree_node_id());
+ DCHECK(navigation_request);
+
+ // Select an appropriate renderer to show the error page.
+ RenderFrameHostImpl* render_frame_host =
+ frame_tree_node->render_manager()->GetFrameHostForNavigation(
+ *navigation_request);
+ CheckWebUIRendererDoesNotDisplayNormalURL(
+ render_frame_host, navigation_request->common_params().url);
+
+ render_frame_host->FailedNavigation(navigation_request->common_params(),
+ navigation_request->request_params(),
+ has_stale_copy_in_cache, error_code);
+}
+
+// PlzNavigate
void NavigatorImpl::CancelNavigation(FrameTreeNode* frame_tree_node) {
CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableBrowserSideNavigation));
« no previous file with comments | « content/browser/frame_host/navigator_impl.h ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698