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

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

Issue 8588039: Remove "open in new tab" items from context menu if the process doesn't (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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.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();

Powered by Google App Engine
This is Rietveld 408576698