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

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

Issue 2436253002: PlzNavigate: Fix the FindInPageControllerTest.SearchWithinSpecialURL browser test. (Closed)
Patch Set: Revert changes to navigator_impl.cc 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 | « chrome/browser/ui/find_bar/find_bar_host_browsertest.cc ('k') | content/browser/loader/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_request.cc
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index c13a7e7f346df429cfd58896da678a198019f258..228cb161e1a2e1f5cac83ee42c5955f419701941 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -6,6 +6,7 @@
#include <utility>
+#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/devtools/render_frame_devtools_agent_host.h"
#include "content/browser/frame_host/frame_tree.h"
#include "content/browser/frame_host/frame_tree_node.h"
@@ -15,6 +16,7 @@
#include "content/browser/frame_host/navigator.h"
#include "content/browser/frame_host/navigator_impl.h"
#include "content/browser/loader/navigation_url_loader.h"
+#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/browser/service_worker/service_worker_navigation_handle.h"
#include "content/browser/site_instance_impl.h"
@@ -513,8 +515,15 @@ void NavigationRequest::OnRedirectChecksComplete(
CHECK(result != NavigationThrottle::DEFER);
// Abort the request if needed. This will destroy the NavigationRequest.
+ // For non browser initiated navigations we need to check if the renderer
+ // process associated with the SiteInstance has access to the URL.
if (result == NavigationThrottle::CANCEL_AND_IGNORE ||
- result == NavigationThrottle::CANCEL) {
+ result == NavigationThrottle::CANCEL ||
+ (!browser_initiated_ &&
Charlie Reis 2016/10/21 23:01:43 nit: Would be clearer to move this complex conditi
ananta 2016/10/22 00:20:42 Done.
+ !ChildProcessSecurityPolicyImpl::GetInstance()->CanRequestURL(
+ frame_tree_node()->current_frame_host()->GetSiteInstance()->
Charlie Reis 2016/10/21 23:01:44 This looks incorrect to me in the case that anothe
ananta 2016/10/22 00:20:42 Added a check for both source and target site inst
+ GetProcess()->GetID(),
+ common_params_.url))) {
// TODO(clamy): distinguish between CANCEL and CANCEL_AND_IGNORE.
frame_tree_node_->ResetNavigationRequest(false);
return;
« no previous file with comments | « chrome/browser/ui/find_bar/find_bar_host_browsertest.cc ('k') | content/browser/loader/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698