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

Unified Diff: net/base/upload_element.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_element.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_element.cc
diff --git a/net/base/upload_element.cc b/net/base/upload_element.cc
index b6bdbeda1d1ac31e436ec15f49deecc9df28b382..d4760b2594085ea1d01f941cd044e39f193cf683 100644
--- a/net/base/upload_element.cc
+++ b/net/base/upload_element.cc
@@ -19,7 +19,6 @@ UploadElement::UploadElement()
bytes_length_(0),
file_range_offset_(0),
file_range_length_(kuint64max),
- is_last_chunk_(false),
override_content_length_(false),
content_length_computed_(false),
content_length_(-1),
@@ -37,19 +36,11 @@ UploadElement::~UploadElement() {
}
}
-void UploadElement::SetToChunk(const char* bytes,
- int bytes_len,
- bool is_last_chunk) {
- type_ = TYPE_CHUNK;
- buf_.assign(bytes, bytes + bytes_len);
- is_last_chunk_ = is_last_chunk;
-}
-
uint64 UploadElement::GetContentLength() {
if (override_content_length_ || content_length_computed_)
return content_length_;
- if (type_ == TYPE_BYTES || type_ == TYPE_CHUNK)
+ if (type_ == TYPE_BYTES)
return bytes_length();
DCHECK_EQ(TYPE_FILE, type_);
@@ -82,7 +73,7 @@ uint64 UploadElement::GetContentLength() {
}
int UploadElement::ReadSync(char* buf, int buf_len) {
- if (type_ == TYPE_BYTES || type_ == TYPE_CHUNK) {
+ if (type_ == TYPE_BYTES) {
return ReadFromMemorySync(buf, buf_len);
} else if (type_ == TYPE_FILE) {
return ReadFromFileSync(buf, buf_len);
@@ -136,7 +127,7 @@ FileStream* UploadElement::OpenFileStream() {
int UploadElement::ReadFromMemorySync(char* buf, int buf_len) {
DCHECK_LT(0, buf_len);
- DCHECK(type_ == TYPE_BYTES || type_ == TYPE_CHUNK);
+ DCHECK(type_ == TYPE_BYTES);
const size_t num_bytes_to_read = std::min(BytesRemaining(),
static_cast<uint64>(buf_len));
« no previous file with comments | « net/base/upload_element.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698