diff options
author | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 23:37:50 +0000 |
---|---|---|
committer | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 23:37:50 +0000 |
commit | 7a6db4024aa668fd49741c4c34965ab674efaac6 (patch) | |
tree | 291de61ee2f86da940a5c9c0a67a79d394478a8e /net/base/upload_data_stream.h | |
parent | e8b3ddfde11a59bc910697090906dd36f0426401 (diff) | |
download | chromium_src-7a6db4024aa668fd49741c4c34965ab674efaac6.zip chromium_src-7a6db4024aa668fd49741c4c34965ab674efaac6.tar.gz chromium_src-7a6db4024aa668fd49741c4c34965ab674efaac6.tar.bz2 |
Support sending a sliced file in chromium.
BUG=none
TEST=The WebKit Layout test.
Review URL: http://codereview.chromium.org/594036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42559 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/upload_data_stream.h')
-rw-r--r-- | net/base/upload_data_stream.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/net/base/upload_data_stream.h b/net/base/upload_data_stream.h index 0dd7dd3..b326dae 100644 --- a/net/base/upload_data_stream.h +++ b/net/base/upload_data_stream.h @@ -14,7 +14,11 @@ class IOBuffer; class UploadDataStream { public: - explicit UploadDataStream(const UploadData* data); + // 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); + ~UploadDataStream(); // Returns the stream's buffer and buffer length. @@ -38,9 +42,14 @@ class UploadDataStream { bool eof() const { return eof_; } 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); + // Fills the buffer with any remaining data and sets eof_ if there was nothing // left to fill the buffer with. - void FillBuf(); + // Returns OK if the operation succeeds. Otherwise error code is returned. + int FillBuf(); const UploadData* data_; |