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

Unified Diff: net/base/elements_upload_data_stream.cc

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « net/base/dns_util.cc ('k') | net/base/file_stream_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/elements_upload_data_stream.cc
diff --git a/net/base/elements_upload_data_stream.cc b/net/base/elements_upload_data_stream.cc
index 86ea28c72135021f6292ae7d2ec7d73bb17a318e..e8d33ee851a1229274224f2c2e3d74aedcb547df 100644
--- a/net/base/elements_upload_data_stream.cc
+++ b/net/base/elements_upload_data_stream.cc
@@ -129,10 +129,10 @@ int ElementsUploadDataStream::ReadElements(
if (read_failed_) {
// If an error occured during read operation, then pad with zero.
// Otherwise the server will hang waiting for the rest of the data.
- int num_bytes_to_fill = std::min(
+ int num_bytes_to_fill = static_cast<int>(std::min(
static_cast<uint64>(buf->BytesRemaining()),
- size() - position() - buf->BytesConsumed());
- DCHECK_LE(0, num_bytes_to_fill);
+ size() - position() - buf->BytesConsumed()));
+ DCHECK_GE(num_bytes_to_fill, 0);
memset(buf->data(), 0, num_bytes_to_fill);
buf->DidConsume(num_bytes_to_fill);
}
« no previous file with comments | « net/base/dns_util.cc ('k') | net/base/file_stream_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698