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

Unified Diff: net/base/upload_data_stream.cc

Issue 2030353002: UploadDataStream now returns errors on failures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments in the header Created 4 years, 6 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
« net/base/upload_data_stream.h ('K') | « net/base/upload_data_stream.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/upload_data_stream.cc
diff --git a/net/base/upload_data_stream.cc b/net/base/upload_data_stream.cc
index a7542778ff5a0bf93968eca29888c835bfa3f6e8..d78a997be0342998bb7d65e2c83b17b16a2e9490 100644
--- a/net/base/upload_data_stream.cc
+++ b/net/base/upload_data_stream.cc
@@ -109,17 +109,18 @@ void UploadDataStream::OnInitCompleted(int result) {
}
void UploadDataStream::OnReadCompleted(int result) {
- DCHECK_GE(result, 0);
- DCHECK(initialized_successfully_);
+ if (result > 0) {
+ DCHECK(initialized_successfully_);
mmenke 2016/06/06 16:22:33 I think this DCHECK can go before the if.
maksims (do not use this acc) 2016/06/21 11:09:25 Done.
- current_position_ += result;
- if (!is_chunked_) {
- DCHECK_LE(current_position_, total_size_);
- if (current_position_ == total_size_)
- is_eof_ = true;
- }
+ current_position_ += result;
+ if (!is_chunked_) {
+ DCHECK_LE(current_position_, total_size_);
+ if (current_position_ == total_size_)
+ is_eof_ = true;
+ }
- DCHECK(result > 0 || is_eof_);
+ DCHECK(result > 0 || is_eof_);
mmenke 2016/06/06 16:22:33 This DCHECK no longer does anything. Suggest movi
maksims (do not use this acc) 2016/06/21 11:09:25 Done.
+ }
if (!callback_.is_null())
base::ResetAndReturn(&callback_).Run(result);
« net/base/upload_data_stream.h ('K') | « net/base/upload_data_stream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698