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

Unified Diff: content/browser/loader/resource_loader.cc

Issue 2436253002: PlzNavigate: Fix the FindInPageControllerTest.SearchWithinSpecialURL browser test. (Closed)
Patch Set: Address comments Created 4 years, 2 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/loader/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/resource_loader.cc
diff --git a/content/browser/loader/resource_loader.cc b/content/browser/loader/resource_loader.cc
index 1993da2f4a687ec9606ea633d777d7121c2575a0..4b573564c34799f7d434c75c8934df7faa2f5ff1 100644
--- a/content/browser/loader/resource_loader.cc
+++ b/content/browser/loader/resource_loader.cc
@@ -25,6 +25,7 @@
#include "content/browser/ssl/ssl_client_auth_handler.h"
#include "content/browser/ssl/ssl_manager.h"
#include "content/public/browser/resource_dispatcher_host_login_delegate.h"
+#include "content/public/common/browser_side_navigation_policy.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/process_type.h"
@@ -256,14 +257,21 @@ void ResourceLoader::OnReceivedRedirect(net::URLRequest* unused,
ResourceRequestInfoImpl* info = GetRequestInfo();
- if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanRequestURL(
- info->GetChildID(), redirect_info.new_url)) {
- DVLOG(1) << "Denied unauthorized request for "
- << redirect_info.new_url.possibly_invalid_spec();
+ // With PlzNavigate for frame navigations this check is done in the
+ // NavigationRequest::OnReceivedRedirect() function.
+ bool check_handled_elsewhere = IsBrowserSideNavigationEnabled() &&
+ IsResourceTypeFrame(info->GetResourceType());
- // Tell the renderer that this request was disallowed.
- Cancel();
- return;
+ if (!check_handled_elsewhere) {
+ if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanRequestURL(
+ info->GetChildID(), redirect_info.new_url)) {
+ DVLOG(1) << "Denied unauthorized request for "
+ << redirect_info.new_url.possibly_invalid_spec();
+
+ // Tell the renderer that this request was disallowed.
+ Cancel();
+ return;
+ }
}
if (delegate_->HandleExternalProtocol(this, redirect_info.new_url)) {
« no previous file with comments | « content/browser/loader/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698