Index: net/base/upload_data_stream.h |
diff --git a/net/base/upload_data_stream.h b/net/base/upload_data_stream.h |
index 8583fb46b850bc69e0705dbb403781a0af2e20a4..f291140348b7d2acea7b940eee783771fa36e018 100644 |
--- a/net/base/upload_data_stream.h |
+++ b/net/base/upload_data_stream.h |
@@ -30,7 +30,12 @@ class UploadDataStream { |
// Call to indicate that a portion of the stream's buffer was consumed. This |
// call modifies the stream's buffer so that it contains the next segment of |
// the upload data to be consumed. |
- void DidConsume(size_t num_bytes); |
+ void MarkConsumedAndFillBuffer(size_t num_bytes); |
+ |
+ // Sets the callback to be invoked when new chunks are available to upload. |
+ void set_chunk_callback(ChunkCallback* callback) { |
+ data_->set_chunk_callback(callback); |
+ } |
// Returns the total size of the data stream and the current position. |
// size() is not to be used to determine whether the stream has ended |
@@ -39,6 +44,8 @@ class UploadDataStream { |
uint64 size() const { return total_size_; } |
uint64 position() const { return current_position_; } |
+ bool is_chunked() const { return data_->is_chunked(); } |
+ |
// Returns whether there is no more data to read, regardless of whether |
// position < size. |
bool eof() const { return eof_; } |
@@ -64,8 +71,8 @@ class UploadDataStream { |
scoped_refptr<IOBuffer> buf_; |
size_t buf_len_; |
- // Iterator to the upload element to be written to the send buffer next. |
- std::vector<UploadData::Element>::iterator next_element_; |
+ // Index of the upload element to be written to the send buffer next. |
+ size_t next_element_; |
// The byte offset into next_element_'s data buffer if the next element is |
// a TYPE_BYTES element. |