summaryrefslogtreecommitdiffstats
path: root/net/base/upload_data_stream.h
diff options
context:
space:
mode:
authorvandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-29 19:58:36 +0000
committervandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-29 19:58:36 +0000
commit6624b46283f1974b8ea3d3b149763b3dd612359d (patch)
treea54ba22b3117fc2c6bcf709bcf9866d21b42ce45 /net/base/upload_data_stream.h
parent1683e11834b15dbd4e0e8161a9ed036d78a8d4d7 (diff)
downloadchromium_src-6624b46283f1974b8ea3d3b149763b3dd612359d.zip
chromium_src-6624b46283f1974b8ea3d3b149763b3dd612359d.tar.gz
chromium_src-6624b46283f1974b8ea3d3b149763b3dd612359d.tar.bz2
Report unreadable files as size zero when uploading.
Upload zero bytes if the file size shrinks. BUG=30850 TEST=uploading an unreadable file works Review URL: http://codereview.chromium.org/1250002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42981 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/upload_data_stream.h')
-rw-r--r--net/base/upload_data_stream.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/base/upload_data_stream.h b/net/base/upload_data_stream.h
index b326dae..9fac07e 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.