diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-29 19:58:36 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-29 19:58:36 +0000 |
commit | 6624b46283f1974b8ea3d3b149763b3dd612359d (patch) | |
tree | a54ba22b3117fc2c6bcf709bcf9866d21b42ce45 /chrome | |
parent | 1683e11834b15dbd4e0e8161a9ed036d78a8d4d7 (diff) | |
download | chromium_src-6624b46283f1974b8ea3d3b149763b3dd612359d.zip chromium_src-6624b46283f1974b8ea3d3b149763b3dd612359d.tar.gz chromium_src-6624b46283f1974b8ea3d3b149763b3dd612359d.tar.bz2 |
Report unreadable files as size zero when uploading.
Upload zero bytes if the file size shrinks.
BUG=30850
TEST=uploading an unreadable file works
Review URL: http://codereview.chromium.org/1250002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42981 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/renderer_host/resource_dispatcher_host.cc | 4 | ||||
-rw-r--r-- | chrome/common/common_param_traits.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc index 143d969..7576926 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc @@ -132,10 +132,10 @@ bool ShouldServiceRequest(ChildProcessInfo::ProcessType process_type, // Check if the renderer is permitted to upload the requested files. if (request_data.upload_data) { - const std::vector<net::UploadData::Element>& uploads = + const std::vector<net::UploadData::Element>* uploads = request_data.upload_data->elements(); std::vector<net::UploadData::Element>::const_iterator iter; - for (iter = uploads.begin(); iter != uploads.end(); ++iter) { + for (iter = uploads->begin(); iter != uploads->end(); ++iter) { if (iter->type() == net::UploadData::TYPE_FILE && !policy->CanUploadFile(child_id, iter->file_path())) { NOTREACHED() << "Denied unauthorized upload of " diff --git a/chrome/common/common_param_traits.h b/chrome/common/common_param_traits.h index 426075a..2288f15 100644 --- a/chrome/common/common_param_traits.h +++ b/chrome/common/common_param_traits.h @@ -361,7 +361,7 @@ struct ParamTraits<scoped_refptr<net::UploadData> > { static void Write(Message* m, const param_type& p) { WriteParam(m, p.get() != NULL); if (p) { - WriteParam(m, p->elements()); + WriteParam(m, *p->elements()); WriteParam(m, p->identifier()); } } |