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

Side by Side Diff: content/browser/frame_host/navigator_impl.cc

Issue 2002633002: PlzNavigate: fix issue preventing navigations to WebUIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Now checking when ready to commit Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/navigator_impl.h" 5 #include "content/browser/frame_host/navigator_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 929
930 // If the request was canceled by the user do not show an error page. 930 // If the request was canceled by the user do not show an error page.
931 if (error_code == net::ERR_ABORTED) { 931 if (error_code == net::ERR_ABORTED) {
932 frame_tree_node->ResetNavigationRequest(false); 932 frame_tree_node->ResetNavigationRequest(false);
933 return; 933 return;
934 } 934 }
935 935
936 // Select an appropriate renderer to show the error page. 936 // Select an appropriate renderer to show the error page.
937 RenderFrameHostImpl* render_frame_host = 937 RenderFrameHostImpl* render_frame_host =
938 frame_tree_node->render_manager()->GetFrameHostForNavigation( 938 frame_tree_node->render_manager()->GetFrameHostForNavigation(
939 *navigation_request); 939 navigation_request);
940 CheckWebUIRendererDoesNotDisplayNormalURL( 940
941 // Perform the appropriate checks for WebUIs.
942 NavigatorImpl::CheckWebUIRendererDoesNotDisplayNormalURL(
941 render_frame_host, navigation_request->common_params().url); 943 render_frame_host, navigation_request->common_params().url);
944 if (!WebUIImpl::RenderProcessAllowedForURL(
945 render_frame_host->GetProcess(),
946 navigation_request->common_params().url)) {
947 frame_tree_node->ResetNavigationRequest(false);
948 return;
949 }
942 950
943 navigation_request->TransferNavigationHandleOwnership(render_frame_host); 951 navigation_request->TransferNavigationHandleOwnership(render_frame_host);
944 render_frame_host->navigation_handle()->ReadyToCommitNavigation( 952 render_frame_host->navigation_handle()->ReadyToCommitNavigation(
945 render_frame_host); 953 render_frame_host);
946 render_frame_host->FailedNavigation(navigation_request->common_params(), 954 render_frame_host->FailedNavigation(navigation_request->common_params(),
947 navigation_request->request_params(), 955 navigation_request->request_params(),
948 has_stale_copy_in_cache, error_code); 956 has_stale_copy_in_cache, error_code);
949 } 957 }
950 958
951 // PlzNavigate 959 // PlzNavigate
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
1164 if (pending_entry != controller_->GetVisibleEntry() || 1172 if (pending_entry != controller_->GetVisibleEntry() ||
1165 !should_preserve_entry) { 1173 !should_preserve_entry) {
1166 controller_->DiscardPendingEntry(true); 1174 controller_->DiscardPendingEntry(true);
1167 1175
1168 // Also force the UI to refresh. 1176 // Also force the UI to refresh.
1169 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); 1177 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL);
1170 } 1178 }
1171 } 1179 }
1172 1180
1173 } // namespace content 1181 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698