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

Unified Diff: net/base/upload_data_stream.cc

Issue 942633004: IndexedDB: Fixed support for empty blobs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed IndexedDBContext::GetOriginBlobFileCount Created 5 years, 9 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
Index: net/base/upload_data_stream.cc
diff --git a/net/base/upload_data_stream.cc b/net/base/upload_data_stream.cc
index 936c9128833017c91e5738b4338974748ec7af4e..43216d4aa34698f53a20ecea17df34439d3888bb 100644
--- a/net/base/upload_data_stream.cc
+++ b/net/base/upload_data_stream.cc
@@ -43,8 +43,8 @@ int UploadDataStream::Read(IOBuffer* buf,
const CompletionCallback& callback) {
DCHECK(!callback.is_null() || IsInMemory());
DCHECK(initialized_successfully_);
- DCHECK_GT(buf_len, 0);
- if (is_eof_)
+ DCHECK_GE(buf_len, 0);
+ if (!buf_len || is_eof_)
michaeln 2015/03/09 21:15:18 This is a little troublesome because generally rea
mmenke 2015/03/09 21:20:09 Can we instead set is_eof_ to true in SetSize, if
mmenke 2015/03/09 21:22:41 The test should be in elements_upload_data_stream_
cmumford 2015/03/09 22:05:11 Reverted this change as suggested.
return 0;
int result = ReadInternal(buf, buf_len);
if (result == ERR_IO_PENDING) {

Powered by Google App Engine
This is Rietveld 408576698