OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/resource_dispatcher_host.h" | 7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 return false; | 146 return false; |
147 } | 147 } |
148 | 148 |
149 // Check if the renderer is permitted to upload the requested files. | 149 // Check if the renderer is permitted to upload the requested files. |
150 if (request_data.upload_data) { | 150 if (request_data.upload_data) { |
151 const std::vector<net::UploadData::Element>* uploads = | 151 const std::vector<net::UploadData::Element>* uploads = |
152 request_data.upload_data->elements(); | 152 request_data.upload_data->elements(); |
153 std::vector<net::UploadData::Element>::const_iterator iter; | 153 std::vector<net::UploadData::Element>::const_iterator iter; |
154 for (iter = uploads->begin(); iter != uploads->end(); ++iter) { | 154 for (iter = uploads->begin(); iter != uploads->end(); ++iter) { |
155 if (iter->type() == net::UploadData::TYPE_FILE && | 155 if (iter->type() == net::UploadData::TYPE_FILE && |
156 !policy->CanUploadFile(child_id, iter->file_path())) { | 156 !policy->CanReadFile(child_id, iter->file_path())) { |
157 NOTREACHED() << "Denied unauthorized upload of " | 157 NOTREACHED() << "Denied unauthorized upload of " |
158 << iter->file_path().value(); | 158 << iter->file_path().value(); |
159 return false; | 159 return false; |
160 } | 160 } |
161 } | 161 } |
162 } | 162 } |
163 | 163 |
164 return true; | 164 return true; |
165 } | 165 } |
166 | 166 |
(...skipping 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1881 return is_prefetch_enabled_; | 1881 return is_prefetch_enabled_; |
1882 } | 1882 } |
1883 | 1883 |
1884 // static | 1884 // static |
1885 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { | 1885 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { |
1886 is_prefetch_enabled_ = value; | 1886 is_prefetch_enabled_ = value; |
1887 } | 1887 } |
1888 | 1888 |
1889 // static | 1889 // static |
1890 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; | 1890 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; |
OLD | NEW |