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

Unified Diff: net/url_request/url_request.cc

Issue 6134003: Prototype of chunked transfer encoded POST. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 11 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
« net/url_request/url_request.h ('K') | « net/url_request/url_request.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request.cc
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index 26a9da247bafa28df8affbaca15144b914aecb38..449992ae93c0743fa32f037a3051bb9a099f30d1 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -160,6 +160,26 @@ void URLRequest::AppendFileRangeToUpload(
expected_modification_time);
}
+void URLRequest::EnableChunkedUpload() {
+ DCHECK(!upload_ || upload_->is_chunked());
+ if (!upload_) {
+ upload_ = new UploadData();
+ upload_->set_is_chunked(true);
+ }
+}
+
+void URLRequest::AppendChunkToUpload(const char* bytes, int bytes_len) {
+ DCHECK(upload_);
+ DCHECK(upload_->is_chunked());
+ DCHECK_GT(bytes_len, 0);
+ upload_->AppendChunk(bytes, bytes_len);
+}
+
+void URLRequest::MarkEndOfChunks() {
+ DCHECK(upload_);
wtc 2011/01/20 00:29:47 Nit: also DCHECK upload_->is_chunked(), as you do
+ upload_->AppendChunk(NULL, 0);
+}
+
void URLRequest::set_upload(net::UploadData* upload) {
upload_ = upload;
}
« net/url_request/url_request.h ('K') | « net/url_request/url_request.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698