diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-24 14:42:30 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-24 14:42:30 +0000 |
commit | 448fc22d9855c0c563e42a8a616eecdca2418891 (patch) | |
tree | e0e89beea783e041a5faf032358aea4cc4f99f61 /content/common/fileapi/webblobregistry_impl.cc | |
parent | af6e0120eb2194b748456377957d1d7bede46f4e (diff) | |
download | chromium_src-448fc22d9855c0c563e42a8a616eecdca2418891.zip chromium_src-448fc22d9855c0c563e42a8a616eecdca2418891.tar.gz chromium_src-448fc22d9855c0c563e42a8a616eecdca2418891.tar.bz2 |
Revert 138554 - Prevent zero-length items from being appended to a blob.
BUG=128266
TEST=as in the bug
Review URL: https://chromiumcodereview.appspot.com/10386183
TBR=ericu@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10444010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138791 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common/fileapi/webblobregistry_impl.cc')
-rw-r--r-- | content/common/fileapi/webblobregistry_impl.cc | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/content/common/fileapi/webblobregistry_impl.cc b/content/common/fileapi/webblobregistry_impl.cc index 9a80fb9..924e919 100644 --- a/content/common/fileapi/webblobregistry_impl.cc +++ b/content/common/fileapi/webblobregistry_impl.cc @@ -39,8 +39,6 @@ void WebBlobRegistryImpl::registerBlobURL( case WebBlobData::Item::TypeData: { // WebBlobData does not allow partial data items. DCHECK(!data_item.offset && data_item.length == -1); - if (data_item.data.size() == 0) - break; if (data_item.data.size() < kLargeThresholdBytes) { item.SetToData(data_item.data.data(), data_item.data.size()); child_thread_->Send(new BlobHostMsg_AppendBlobDataItem(url, item)); @@ -66,14 +64,12 @@ void WebBlobRegistryImpl::registerBlobURL( break; } case WebBlobData::Item::TypeFile: - if (data_item.length) { - item.SetToFile( - webkit_glue::WebStringToFilePath(data_item.filePath), - static_cast<uint64>(data_item.offset), - static_cast<uint64>(data_item.length), - base::Time::FromDoubleT(data_item.expectedModificationTime)); - child_thread_->Send(new BlobHostMsg_AppendBlobDataItem(url, item)); - } + item.SetToFile( + webkit_glue::WebStringToFilePath(data_item.filePath), + static_cast<uint64>(data_item.offset), + static_cast<uint64>(data_item.length), + base::Time::FromDoubleT(data_item.expectedModificationTime)); + child_thread_->Send(new BlobHostMsg_AppendBlobDataItem(url, item)); break; case WebBlobData::Item::TypeBlob: if (data_item.length) { @@ -81,8 +77,8 @@ void WebBlobRegistryImpl::registerBlobURL( data_item.blobURL, static_cast<uint64>(data_item.offset), static_cast<uint64>(data_item.length)); - child_thread_->Send(new BlobHostMsg_AppendBlobDataItem(url, item)); } + child_thread_->Send(new BlobHostMsg_AppendBlobDataItem(url, item)); break; default: NOTREACHED(); |