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

Unified Diff: net/base/upload_data.h

Issue 10910268: net: Make UploadDataStream::Read() asynchronous (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 2 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_bytes_element_reader_unittest.cc ('k') | net/base/upload_data_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/upload_data.h
diff --git a/net/base/upload_data.h b/net/base/upload_data.h
index b35263cc23352b83637ce3c1a9eb4df6a49c8e6a..395a57b471d13cf19fb4dff5b60eee2e2b023565 100644
--- a/net/base/upload_data.h
+++ b/net/base/upload_data.h
@@ -40,6 +40,12 @@ class NET_EXPORT_PRIVATE ChunkCallback {
// Until there is a more abstract class for this, this one derives from
// SupportsUserData to allow users to stash random data by
// key and ensure its destruction when UploadData is finally deleted.
+//
+// Chunked uploads are handled by repeatedly calling AppendChunk() as data
+// becomes available. When more data becomes available, the ChunkCallback's
+// OnChunkAvailable function is called. The UploadData creator is then
+// responsible for checking if the UploadData stream has more data available, if
+// necessary.
class NET_EXPORT UploadData
: public base::RefCounted<UploadData>,
public base::SupportsUserData {
@@ -60,10 +66,11 @@ class NET_EXPORT UploadData
void set_chunk_callback(ChunkCallback* callback);
// Initializes the object to send chunks of upload data over time rather
- // than all at once.
+ // than all at once. Chunked data may only contain bytes, not files.
void set_is_chunked(bool set) { is_chunked_ = set; }
bool is_chunked() const { return is_chunked_; }
+ // set_last_chunk_appended() is only used for serialization.
void set_last_chunk_appended(bool set) { last_chunk_appended_ = set; }
bool last_chunk_appended() const { return last_chunk_appended_; }
« no previous file with comments | « net/base/upload_bytes_element_reader_unittest.cc ('k') | net/base/upload_data_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698