diff options
author | hashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-29 18:46:31 +0000 |
---|---|---|
committer | hashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-29 18:46:31 +0000 |
commit | fac16e28cf239ff9d59b4d7de644eca6077c9149 (patch) | |
tree | b7712c540d62d200cee98ad5b9c898ab20b22452 /net/base/upload_element_reader.h | |
parent | 2330a29dc4aeb430cde65f6a73aaf8326ac3bf70 (diff) | |
download | chromium_src-fac16e28cf239ff9d59b4d7de644eca6077c9149.zip chromium_src-fac16e28cf239ff9d59b4d7de644eca6077c9149.tar.gz chromium_src-fac16e28cf239ff9d59b4d7de644eca6077c9149.tar.bz2 |
net: Allow UploadElementReader to report errors on Read()
Since UploadElementReader may be implemented by random user code, this error covering logic should be in UploadDataStream, rather than each UploadElementReader implementation.
UploadFileElementReader reports error when something goes wrong with FileStream::ReadSync().
UploadDataStream is responsible to handle errors and to zero-fill the buffer.
BUG=None
TEST=net_unittests
Review URL: https://chromiumcodereview.appspot.com/11661005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174771 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/upload_element_reader.h')
-rw-r--r-- | net/base/upload_element_reader.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/base/upload_element_reader.h b/net/base/upload_element_reader.h index 01f91fb..d71f57c 100644 --- a/net/base/upload_element_reader.h +++ b/net/base/upload_element_reader.h @@ -47,10 +47,8 @@ class NET_EXPORT UploadElementReader { virtual bool IsInMemory() const; // Reads up to |buf_length| bytes synchronously and returns the number of - // bytes read when possible, otherwise, returns ERR_IO_PENDING and runs - // |callback| with the result. This function never fails. If there's less data - // to read than we initially observed, then pad with zero (this can happen - // with files). |buf_length| must be greater than 0. + // bytes read or error code when possible, otherwise, returns ERR_IO_PENDING + // and runs |callback| with the result. |buf_length| must be greater than 0. virtual int Read(IOBuffer* buf, int buf_length, const CompletionCallback& callback) = 0; |