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

Unified Diff: net/base/upload_data.cc

Issue 10861036: net: Remove UploadElement::TYPE_CHUNK (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unused UploadElement::set_type() Created 8 years, 4 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 | « net/base/upload_data.h ('k') | net/base/upload_data_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/upload_data.cc
diff --git a/net/base/upload_data.cc b/net/base/upload_data.cc
index ca35d1292e1d77bace6b34b57a7122ed37f01f55..f3dc22c03ab2160b76e75e6fb80605eaa56ba8e4 100644
--- a/net/base/upload_data.cc
+++ b/net/base/upload_data.cc
@@ -25,7 +25,8 @@ void OnGetContentLengthComplete(
UploadData::UploadData()
: identifier_(0),
chunk_callback_(NULL),
- is_chunked_(false) {
+ is_chunked_(false),
+ last_chunk_appended_(false) {
}
void UploadData::AppendBytes(const char* bytes, int bytes_len) {
@@ -49,8 +50,10 @@ void UploadData::AppendChunk(const char* bytes,
int bytes_len,
bool is_last_chunk) {
DCHECK(is_chunked_);
+ DCHECK(!last_chunk_appended_);
elements_.push_back(UploadElement());
- elements_.back().SetToChunk(bytes, bytes_len, is_last_chunk);
+ elements_.back().SetToBytes(bytes, bytes_len);
+ last_chunk_appended_ = is_last_chunk;
if (chunk_callback_)
chunk_callback_->OnChunkAvailable();
}
« no previous file with comments | « net/base/upload_data.h ('k') | net/base/upload_data_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698