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

Unified Diff: net/base/upload_data_stream.cc

Issue 9384: UploadDataStream::Reset should call FillBuf to return... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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_stream.h ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/upload_data_stream.cc
===================================================================
--- net/base/upload_data_stream.cc (revision 4818)
+++ net/base/upload_data_stream.cc (working copy)
@@ -11,8 +11,12 @@
UploadDataStream::UploadDataStream(const UploadData* data)
: data_(data),
- total_size_(data->GetContentLength()) {
- Reset();
+ buf_len_(0),
+ next_element_(data->elements().begin()),
+ next_element_offset_(0),
+ next_element_remaining_(0),
+ total_size_(data->GetContentLength()),
+ current_position_(0) {
FillBuf();
}
@@ -31,15 +35,6 @@
current_position_ += num_bytes;
}
-void UploadDataStream::Reset() {
- next_element_stream_.Close();
- buf_len_ = 0;
- next_element_ = data_->elements().begin();
- next_element_offset_ = 0;
- next_element_remaining_ = 0;
- current_position_ = 0;
-}
-
void UploadDataStream::FillBuf() {
std::vector<UploadData::Element>::const_iterator end =
data_->elements().end();
@@ -68,7 +63,7 @@
DCHECK(element.type() == UploadData::TYPE_FILE);
if (!next_element_stream_.IsOpen()) {
- int flags = base::PLATFORM_FILE_OPEN |
+ int flags = base::PLATFORM_FILE_OPEN |
base::PLATFORM_FILE_READ;
int rv = next_element_stream_.Open(element.file_path(), flags);
// If the file does not exist, that's technically okay.. we'll just
« no previous file with comments | « net/base/upload_data_stream.h ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698