| 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/renderer_host/resource_dispatcher_host_impl.h" | 7 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 << request_data.url.possibly_invalid_spec(); | 171 << request_data.url.possibly_invalid_spec(); |
| 172 return false; | 172 return false; |
| 173 } | 173 } |
| 174 | 174 |
| 175 // Check if the renderer is permitted to upload the requested files. | 175 // Check if the renderer is permitted to upload the requested files. |
| 176 if (request_data.request_body) { | 176 if (request_data.request_body) { |
| 177 const std::vector<ResourceRequestBody::Element>* uploads = | 177 const std::vector<ResourceRequestBody::Element>* uploads = |
| 178 request_data.request_body->elements(); | 178 request_data.request_body->elements(); |
| 179 std::vector<ResourceRequestBody::Element>::const_iterator iter; | 179 std::vector<ResourceRequestBody::Element>::const_iterator iter; |
| 180 for (iter = uploads->begin(); iter != uploads->end(); ++iter) { | 180 for (iter = uploads->begin(); iter != uploads->end(); ++iter) { |
| 181 if (iter->type() == ResourceRequestBody::TYPE_FILE && | 181 if (iter->type() == ResourceRequestBody::Element::TYPE_FILE && |
| 182 !policy->CanReadFile(child_id, iter->file_path())) { | 182 !policy->CanReadFile(child_id, iter->path())) { |
| 183 NOTREACHED() << "Denied unauthorized upload of " | 183 NOTREACHED() << "Denied unauthorized upload of " |
| 184 << iter->file_path().value(); | 184 << iter->path().value(); |
| 185 return false; | 185 return false; |
| 186 } | 186 } |
| 187 } | 187 } |
| 188 } | 188 } |
| 189 | 189 |
| 190 return true; | 190 return true; |
| 191 } | 191 } |
| 192 | 192 |
| 193 void RemoveDownloadFileFromChildSecurityPolicy(int child_id, | 193 void RemoveDownloadFileFromChildSecurityPolicy(int child_id, |
| 194 const FilePath& path) { | 194 const FilePath& path) { |
| (...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1728 | 1728 |
| 1729 return i->second.get(); | 1729 return i->second.get(); |
| 1730 } | 1730 } |
| 1731 | 1731 |
| 1732 ResourceLoader* ResourceDispatcherHostImpl::GetLoader(int child_id, | 1732 ResourceLoader* ResourceDispatcherHostImpl::GetLoader(int child_id, |
| 1733 int request_id) const { | 1733 int request_id) const { |
| 1734 return GetLoader(GlobalRequestID(child_id, request_id)); | 1734 return GetLoader(GlobalRequestID(child_id, request_id)); |
| 1735 } | 1735 } |
| 1736 | 1736 |
| 1737 } // namespace content | 1737 } // namespace content |
| OLD | NEW |