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 for (iter = uploads->begin(); iter != uploads->end(); ++iter) { | 209 for (iter = uploads->begin(); iter != uploads->end(); ++iter) { |
210 if (iter->type() == ResourceRequestBody::Element::TYPE_FILE && | 210 if (iter->type() == ResourceRequestBody::Element::TYPE_FILE && |
211 !policy->CanReadFile(child_id, iter->path())) { | 211 !policy->CanReadFile(child_id, iter->path())) { |
212 NOTREACHED() << "Denied unauthorized upload of " | 212 NOTREACHED() << "Denied unauthorized upload of " |
213 << iter->path().value(); | 213 << iter->path().value(); |
214 return false; | 214 return false; |
215 } | 215 } |
216 if (iter->type() == ResourceRequestBody::Element::TYPE_FILE_FILESYSTEM) { | 216 if (iter->type() == ResourceRequestBody::Element::TYPE_FILE_FILESYSTEM) { |
217 fileapi::FileSystemURL url = | 217 fileapi::FileSystemURL url = |
218 file_system_context->CrackURL(iter->filesystem_url()); | 218 file_system_context->CrackURL(iter->filesystem_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->filesystem_url().spec(); | 221 << iter->filesystem_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 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1869 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) | 1868 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) |
1870 && !policy->CanReadRawCookies(child_id)) { | 1869 && !policy->CanReadRawCookies(child_id)) { |
1871 VLOG(1) << "Denied unauthorized request for raw headers"; | 1870 VLOG(1) << "Denied unauthorized request for raw headers"; |
1872 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; | 1871 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; |
1873 } | 1872 } |
1874 | 1873 |
1875 return load_flags; | 1874 return load_flags; |
1876 } | 1875 } |
1877 | 1876 |
1878 } // namespace content | 1877 } // namespace content |
OLD | NEW |