Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1529)

Unified Diff: content/common/fileapi/webblobregistry_impl.cc

Issue 10444010: Revert 138554 - Prevent zero-length items from being appended to a blob. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/fileapi/fileapi_message_filter.cc ('k') | webkit/blob/blob_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/fileapi/webblobregistry_impl.cc
===================================================================
--- content/common/fileapi/webblobregistry_impl.cc (revision 138789)
+++ content/common/fileapi/webblobregistry_impl.cc (working copy)
@@ -39,8 +39,6 @@
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 @@
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 @@
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();
« no previous file with comments | « content/browser/fileapi/fileapi_message_filter.cc ('k') | webkit/blob/blob_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698