| 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 <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 std::vector<ResourceRequestBody::Element>::const_iterator iter; | 209 std::vector<ResourceRequestBody::Element>::const_iterator iter; |
| 210 for (iter = uploads->begin(); iter != uploads->end(); ++iter) { | 210 for (iter = uploads->begin(); iter != uploads->end(); ++iter) { |
| 211 if (iter->type() == ResourceRequestBody::Element::TYPE_FILE && | 211 if (iter->type() == ResourceRequestBody::Element::TYPE_FILE && |
| 212 !policy->CanReadFile(child_id, iter->path())) { | 212 !policy->CanReadFile(child_id, iter->path())) { |
| 213 NOTREACHED() << "Denied unauthorized upload of " | 213 NOTREACHED() << "Denied unauthorized upload of " |
| 214 << iter->path().value(); | 214 << iter->path().value(); |
| 215 return false; | 215 return false; |
| 216 } | 216 } |
| 217 if (iter->type() == ResourceRequestBody::Element::TYPE_FILE_FILESYSTEM) { | 217 if (iter->type() == ResourceRequestBody::Element::TYPE_FILE_FILESYSTEM) { |
| 218 fileapi::FileSystemURL url = file_system_context->CrackURL(iter->url()); | 218 fileapi::FileSystemURL url = file_system_context->CrackURL(iter->url()); |
| 219 if (!policy->HasPermissionsForFileSystemFile( | 219 if (!policy->CanReadFileSystemFile(child_id, url)) { |
| 220 child_id, url, fileapi::kReadFilePermissions)) { | |
| 221 NOTREACHED() << "Denied unauthorized upload of " | 220 NOTREACHED() << "Denied unauthorized upload of " |
| 222 << iter->url().spec(); | 221 << iter->url().spec(); |
| 223 return false; | 222 return false; |
| 224 } | 223 } |
| 225 } | 224 } |
| 226 } | 225 } |
| 227 } | 226 } |
| 228 | 227 |
| 229 return true; | 228 return true; |
| 230 } | 229 } |
| (...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1879 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) | 1878 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) |
| 1880 && !policy->CanReadRawCookies(child_id)) { | 1879 && !policy->CanReadRawCookies(child_id)) { |
| 1881 VLOG(1) << "Denied unauthorized request for raw headers"; | 1880 VLOG(1) << "Denied unauthorized request for raw headers"; |
| 1882 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; | 1881 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; |
| 1883 } | 1882 } |
| 1884 | 1883 |
| 1885 return load_flags; | 1884 return load_flags; |
| 1886 } | 1885 } |
| 1887 | 1886 |
| 1888 } // namespace content | 1887 } // namespace content |
| OLD | NEW |