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