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

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..de882838b84a4eed3bbef9ec7d229379150e478b 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -102,6 +102,7 @@ URLRequest::URLRequest(const GURL& url, Delegate* delegate)
delegate_(delegate),
is_pending_(false),
enable_profiling_(false),
+ chunked_transfer_upload_(false),
redirect_limit_(kMaxRedirects),
final_upload_progress_(0),
priority_(net::LOWEST) {
@@ -160,6 +161,17 @@ void URLRequest::AppendFileRangeToUpload(
expected_modification_time);
}
+void URLRequest::AppendChunkToUpload(const char* bytes, int bytes_len) {
+ DCHECK(bytes_len > 0);
+ DCHECK(upload_);
+ upload_->AppendChunk(bytes, bytes_len);
+}
+
+void URLRequest::MarkEndOfChunks() {
+ DCHECK(upload_);
+ upload_->AppendChunk(NULL, 0);
+}
+
void URLRequest::set_upload(net::UploadData* upload) {
upload_ = upload;
}
@@ -316,6 +328,12 @@ GURL URLRequest::GetSanitizedReferrer() const {
}
void URLRequest::Start() {
+ if (chunked_transfer_upload_) {
+ DCHECK(!upload_);
+ upload_ = new UploadData();
+ upload_->set_is_chunked(true);
+ }
+
StartJob(URLRequestJobManager::GetInstance()->CreateJob(this));
}
« 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