OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 return false; | 115 return false; |
116 } | 116 } |
117 | 117 |
118 // Check if the renderer is permitted to upload the requested files. | 118 // Check if the renderer is permitted to upload the requested files. |
119 if (request_data.upload_data) { | 119 if (request_data.upload_data) { |
120 const std::vector<net::UploadData::Element>& uploads = | 120 const std::vector<net::UploadData::Element>& uploads = |
121 request_data.upload_data->elements(); | 121 request_data.upload_data->elements(); |
122 std::vector<net::UploadData::Element>::const_iterator iter; | 122 std::vector<net::UploadData::Element>::const_iterator iter; |
123 for (iter = uploads.begin(); iter != uploads.end(); ++iter) { | 123 for (iter = uploads.begin(); iter != uploads.end(); ++iter) { |
124 if (iter->type() == net::UploadData::TYPE_FILE && | 124 if (iter->type() == net::UploadData::TYPE_FILE && |
125 !policy->CanUploadFile(process_id, | 125 !policy->CanUploadFile(process_id, iter->file_path())) { |
126 FilePath::FromWStringHack(iter->file_path()))) { | 126 NOTREACHED() << "Denied unauthorized upload of " |
127 NOTREACHED() << "Denied unauthorized upload of " << iter->file_path(); | 127 << iter->file_path().value(); |
128 return false; | 128 return false; |
129 } | 129 } |
130 } | 130 } |
131 } | 131 } |
132 | 132 |
133 return true; | 133 return true; |
134 } | 134 } |
135 | 135 |
136 } // namespace | 136 } // namespace |
137 | 137 |
(...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1552 case ViewHostMsg_UploadProgress_ACK::ID: | 1552 case ViewHostMsg_UploadProgress_ACK::ID: |
1553 case ViewHostMsg_SyncLoad::ID: | 1553 case ViewHostMsg_SyncLoad::ID: |
1554 return true; | 1554 return true; |
1555 | 1555 |
1556 default: | 1556 default: |
1557 break; | 1557 break; |
1558 } | 1558 } |
1559 | 1559 |
1560 return false; | 1560 return false; |
1561 } | 1561 } |
OLD | NEW |