Index: content/browser/renderer_host/resource_dispatcher_host.cc |
=================================================================== |
--- content/browser/renderer_host/resource_dispatcher_host.cc (revision 113019) |
+++ content/browser/renderer_host/resource_dispatcher_host.cc (working copy) |
@@ -154,7 +154,8 @@ |
// if the renderer is attempting to upload an unauthorized file. |
bool ShouldServiceRequest(content::ProcessType process_type, |
int child_id, |
- const ResourceHostMsg_Request& request_data) { |
+ const ResourceHostMsg_Request& request_data, |
+ const net::URLRequestJobFactory* job_factory) { |
if (process_type == content::PROCESS_TYPE_PLUGIN) |
return true; |
@@ -162,7 +163,7 @@ |
ChildProcessSecurityPolicy::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, job_factory)) { |
VLOG(1) << "Denied unauthorized request for " |
<< request_data.url.possibly_invalid_spec(); |
return false; |
@@ -490,7 +491,9 @@ |
} |
if (is_shutdown_ || |
- !ShouldServiceRequest(process_type, child_id, request_data)) { |
+ !ShouldServiceRequest( |
+ process_type, child_id, request_data, |
+ resource_context.request_context()->job_factory())) { |
AbortRequestBeforeItStarts(filter_, sync_result, route_id, request_id); |
return; |
} |
@@ -873,7 +876,7 @@ |
// Check if the renderer is permitted to request the requested URL. |
if (!ChildProcessSecurityPolicy::GetInstance()-> |
- CanRequestURL(child_id, url)) { |
+ CanRequestURL(child_id, url, request_context->job_factory())) { |
VLOG(1) << "Denied unauthorized download request for " |
<< url.possibly_invalid_spec(); |
if (!started_cb.is_null()) |
@@ -904,6 +907,8 @@ |
false); |
} |
+ // FIXME(tsepez); probably redundant in face of passing job_factory to |
+ // ChildProcessSecurityPolicy above. |
if (!request_context->job_factory()->IsHandledURL(url)) { |
VLOG(1) << "Download request for unsupported protocol: " |
<< url.possibly_invalid_spec(); |
@@ -1264,8 +1269,8 @@ |
DCHECK(request->status().is_success()); |
if (info->process_type() != content::PROCESS_TYPE_PLUGIN && |
- !ChildProcessSecurityPolicy::GetInstance()-> |
- CanRequestURL(info->child_id(), new_url)) { |
+ !ChildProcessSecurityPolicy::GetInstance()->CanRequestURL( |
+ info->child_id(), new_url, request->context()->job_factory())) { |
VLOG(1) << "Denied unauthorized request for " |
<< new_url.possibly_invalid_spec(); |