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

Unified Diff: net/base/upload_data_stream.h

Issue 594036: Support sending a sliced file in chromium.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' 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.h ('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
===================================================================
--- net/base/upload_data_stream.h (revision 42417)
+++ net/base/upload_data_stream.h (working copy)
@@ -14,7 +14,11 @@
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 @@
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_;
« no previous file with comments | « net/base/upload_data.h ('k') | net/base/upload_data_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698