| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
| 6 | 6 |
| 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 8 | 8 |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 // Consults the RendererSecurity policy to determine whether the | 286 // Consults the RendererSecurity policy to determine whether the |
| 287 // ResourceDispatcherHostImpl should service this request. A request might be | 287 // ResourceDispatcherHostImpl should service this request. A request might be |
| 288 // disallowed if the renderer is not authorized to retrieve the request URL or | 288 // disallowed if the renderer is not authorized to retrieve the request URL or |
| 289 // if the renderer is attempting to upload an unauthorized file. | 289 // if the renderer is attempting to upload an unauthorized file. |
| 290 bool ShouldServiceRequest(int process_type, | 290 bool ShouldServiceRequest(int process_type, |
| 291 int child_id, | 291 int child_id, |
| 292 const ResourceHostMsg_Request& request_data, | 292 const ResourceHostMsg_Request& request_data, |
| 293 const net::HttpRequestHeaders& headers, | 293 const net::HttpRequestHeaders& headers, |
| 294 ResourceMessageFilter* filter, | 294 ResourceMessageFilter* filter, |
| 295 ResourceContext* resource_context) { | 295 ResourceContext* resource_context) { |
| 296 if (process_type == PROCESS_TYPE_PLUGIN) | |
| 297 return true; | |
| 298 | |
| 299 ChildProcessSecurityPolicyImpl* policy = | 296 ChildProcessSecurityPolicyImpl* policy = |
| 300 ChildProcessSecurityPolicyImpl::GetInstance(); | 297 ChildProcessSecurityPolicyImpl::GetInstance(); |
| 301 | 298 |
| 302 // Check if the renderer is permitted to request the requested URL. | 299 // Check if the renderer is permitted to request the requested URL. |
| 303 if (!policy->CanRequestURL(child_id, request_data.url)) { | 300 if (!policy->CanRequestURL(child_id, request_data.url)) { |
| 304 VLOG(1) << "Denied unauthorized request for " | 301 VLOG(1) << "Denied unauthorized request for " |
| 305 << request_data.url.possibly_invalid_spec(); | 302 << request_data.url.possibly_invalid_spec(); |
| 306 return false; | 303 return false; |
| 307 } | 304 } |
| 308 | 305 |
| (...skipping 2377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2686 ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), child_id); | 2683 ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), child_id); |
| 2687 response->head.security_info = SerializeSecurityInfo(ssl); | 2684 response->head.security_info = SerializeSecurityInfo(ssl); |
| 2688 } | 2685 } |
| 2689 | 2686 |
| 2690 CertStore* ResourceDispatcherHostImpl::GetCertStore() { | 2687 CertStore* ResourceDispatcherHostImpl::GetCertStore() { |
| 2691 return cert_store_for_testing_ ? cert_store_for_testing_ | 2688 return cert_store_for_testing_ ? cert_store_for_testing_ |
| 2692 : CertStore::GetInstance(); | 2689 : CertStore::GetInstance(); |
| 2693 } | 2690 } |
| 2694 | 2691 |
| 2695 } // namespace content | 2692 } // namespace content |
| OLD | NEW |