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

Unified Diff: content/browser/renderer_host/resource_dispatcher_host_impl.cc

Issue 11416121: Prevent cross-site pages when --site-per-process is passed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Created 8 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/browser/renderer_host/resource_dispatcher_host_impl.cc
diff --git a/content/browser/renderer_host/resource_dispatcher_host_impl.cc b/content/browser/renderer_host/resource_dispatcher_host_impl.cc
index 111edc5a9fdabf7eed215daf838f2d97c91f399b..b24a92ba562aec30c1b81c9dd2907c61db8cf683 100644
--- a/content/browser/renderer_host/resource_dispatcher_host_impl.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host_impl.cc
@@ -162,7 +162,8 @@ bool ShouldServiceRequest(ProcessType process_type,
ChildProcessSecurityPolicyImpl::GetInstance();
// Check if the renderer is permitted to request the requested URL.
- if (!policy->CanRequestURL(child_id, request_data.url)) {
+ if (!policy->CanRequestURL(child_id, request_data.url,
+ request_data.resource_type)) {
VLOG(1) << "Denied unauthorized request for "
<< request_data.url.possibly_invalid_spec();
return false;
@@ -526,8 +527,10 @@ net::Error ResourceDispatcherHostImpl::BeginDownload(
}
request->set_load_flags(request->load_flags() | extra_load_flags);
// Check if the renderer is permitted to request the requested URL.
+ // TODO: ResourceType::LAST_TYPE is the place holder, I think it is the
+ // best type to pass.
if (!ChildProcessSecurityPolicyImpl::GetInstance()->
- CanRequestURL(child_id, url)) {
+ CanRequestURL(child_id, url, ResourceType::LAST_TYPE)) {
Charlie Reis 2012/11/28 18:58:26 This is also making me second guess my suggestion
VLOG(1) << "Denied unauthorized download request for "
<< url.possibly_invalid_spec();
return CallbackAndReturn(started_callback, net::ERR_ACCESS_DENIED);

Powered by Google App Engine
This is Rietveld 408576698