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

Unified Diff: net/base/upload_data_stream.h

Issue 1250002: Report unreadable files as size zero when uploading. (Closed)
Patch Set: Address comments Created 10 years, 9 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.cc ('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_stream.h
diff --git a/net/base/upload_data_stream.h b/net/base/upload_data_stream.h
index b326dae6356d02e1e62b9aa0254ca9663ed019e3..9fac07eeb1a3e188bbc1beb5a9d6f1061a0c9649 100644
--- a/net/base/upload_data_stream.h
+++ b/net/base/upload_data_stream.h
@@ -17,7 +17,7 @@ class UploadDataStream {
// Returns a new instance of UploadDataStream if it can be created and
// initialized successfully. If not, NULL will be returned and the error
// code will be set if the output parameter error_code is not empty.
- static UploadDataStream* Create(const UploadData* data, int* error_code);
+ static UploadDataStream* Create(UploadData* data, int* error_code);
~UploadDataStream();
@@ -44,14 +44,14 @@ class UploadDataStream {
private:
// Protects from public access since now we have a static creator function
// which will do both creation and initialization and might return an error.
- explicit UploadDataStream(const UploadData* data);
+ explicit UploadDataStream(UploadData* data);
// Fills the buffer with any remaining data and sets eof_ if there was nothing
// left to fill the buffer with.
// Returns OK if the operation succeeds. Otherwise error code is returned.
int FillBuf();
- const UploadData* data_;
+ UploadData* data_;
// This buffer is filled with data to be uploaded. The data to be sent is
// always at the front of the buffer. If we cannot send all of the buffer at
@@ -62,7 +62,7 @@ class UploadDataStream {
size_t buf_len_;
// Iterator to the upload element to be written to the send buffer next.
- std::vector<UploadData::Element>::const_iterator next_element_;
+ std::vector<UploadData::Element>::iterator next_element_;
// The byte offset into next_element_'s data buffer if the next element is
// a TYPE_BYTES element.
@@ -70,7 +70,7 @@ class UploadDataStream {
// A stream to the currently open file, for next_element_ if the next element
// is a TYPE_FILE element.
- FileStream next_element_stream_;
+ scoped_ptr<FileStream> next_element_stream_;
// The number of bytes remaining to be read from the currently open file
// if the next element is of TYPE_FILE.
« no previous file with comments | « net/base/upload_data.cc ('k') | net/base/upload_data_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698