| Index: net/url_request/url_fetcher_core.cc
|
| diff --git a/net/url_request/url_fetcher_core.cc b/net/url_request/url_fetcher_core.cc
|
| index 420e83147b48c09c24c5967edef462a7357cef0d..371908a9b2e4117ec06aaf0eb8f5edbb66035354 100644
|
| --- a/net/url_request/url_fetcher_core.cc
|
| +++ b/net/url_request/url_fetcher_core.cc
|
| @@ -142,6 +142,7 @@ void URLFetcherCore::SetUploadData(const std::string& upload_content_type,
|
| DCHECK(upload_content_.empty());
|
| DCHECK(upload_file_path_.empty());
|
| DCHECK(upload_content_type_.empty());
|
| + DCHECK(!upload_stream_);
|
|
|
| // Empty |upload_content_type| is allowed iff the |upload_content| is empty.
|
| DCHECK(upload_content.empty() || !upload_content_type.empty());
|
| @@ -165,6 +166,7 @@ void URLFetcherCore::SetUploadFilePath(
|
| DCHECK_EQ(upload_range_length_, 0ULL);
|
| DCHECK(upload_content_type_.empty());
|
| DCHECK(!upload_content_type.empty());
|
| + DCHECK(!upload_stream_);
|
|
|
| upload_content_type_ = upload_content_type;
|
| upload_file_path_ = file_path;
|
| @@ -174,6 +176,20 @@ void URLFetcherCore::SetUploadFilePath(
|
| upload_content_set_ = true;
|
| }
|
|
|
| +void URLFetcherCore::SetUploadStream(const std::string& upload_content_type,
|
| + scoped_ptr<net::UploadDataStream> stream) {
|
| + DCHECK(!is_chunked_upload_);
|
| + DCHECK(!upload_content_set_);
|
| + DCHECK(upload_content_.empty());
|
| + DCHECK(upload_file_path_.empty());
|
| + DCHECK(upload_content_type_.empty());
|
| + DCHECK(!upload_stream_);
|
| +
|
| + upload_content_type_ = upload_content_type;
|
| + upload_stream_ = stream.Pass();
|
| + upload_content_set_ = true;
|
| +}
|
| +
|
| void URLFetcherCore::SetChunkedUpload(const std::string& content_type) {
|
| DCHECK(is_chunked_upload_ ||
|
| (upload_content_type_.empty() &&
|
| @@ -605,6 +621,8 @@ void URLFetcherCore::StartURLRequest() {
|
| base::Time()));
|
| request_->set_upload(
|
| ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0));
|
| + } else if (upload_stream_) {
|
| + request_->set_upload(upload_stream_.Pass());
|
| }
|
|
|
| current_upload_bytes_ = -1;
|
|
|