Chromium Code Reviews| Index: net/base/upload_data.h |
| diff --git a/net/base/upload_data.h b/net/base/upload_data.h |
| index 6f7216250a40c536a8cbdf1eba70c02d67fdb342..1658c13756762f7b475f7511520e46041c5bee46 100644 |
| --- a/net/base/upload_data.h |
| +++ b/net/base/upload_data.h |
| @@ -13,6 +13,7 @@ |
| #include "base/gtest_prod_util.h" |
| #include "base/ref_counted.h" |
| #include "googleurl/src/gurl.h" |
| +#include "net/base/completion_callback.h" |
| #include "base/time.h" |
| namespace net { |
| @@ -23,6 +24,7 @@ class UploadData : public base::RefCounted<UploadData> { |
| public: |
| enum Type { |
| TYPE_BYTES, |
| + TYPE_CHUNK, // Indicates that more data is to come. |
|
wtc
2011/01/12 02:39:02
The more important info is "send the data immediat
Satish
2011/01/13 17:43:27
Done.
|
| TYPE_FILE, |
| TYPE_BLOB |
| }; |
| @@ -72,6 +74,8 @@ class UploadData : public base::RefCounted<UploadData> { |
| blob_url_ = blob_url; |
| } |
| + void SetToChunk(const char* bytes, int bytes_len); |
| + |
| // Returns the byte-length of the element. For files that do not exist, 0 |
| // is returned. This is done for consistency with Mozilla. |
| // Once called, this function will always return the same value. |
| @@ -119,6 +123,16 @@ class UploadData : public base::RefCounted<UploadData> { |
| void AppendBlob(const GURL& blob_url); |
| + void AppendChunk(const char* bytes, int bytes_len); |
| + |
| + // Sets the callback to be invoked when new data is available to upload. |
| + void set_data_callback(CompletionCallback* callback); |
|
wtc
2011/01/12 02:39:02
Rename this method set_chunk_callback and the memb
Satish
2011/01/13 17:43:27
Done.
|
| + |
| + // Iniitalizes the object to receive chunks of upload data over time rather |
| + // than all at once at connection time. |
|
wtc
2011/01/12 02:39:02
The UploadData class doesn't know about the connec
Satish
2011/01/13 17:43:27
Done.
|
| + void set_is_chunked(bool set) { is_chunked_ = set; } |
| + bool is_chunked() { return is_chunked_; } |
| + |
| // Returns the total size in bytes of the data to upload. |
| uint64 GetContentLength(); |
| @@ -145,6 +159,8 @@ class UploadData : public base::RefCounted<UploadData> { |
| std::vector<Element> elements_; |
| int64 identifier_; |
| + CompletionCallback* data_callback_; |
| + bool is_chunked_; |
| DISALLOW_COPY_AND_ASSIGN(UploadData); |
| }; |