diff options
author | hashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-28 19:50:40 +0000 |
---|---|---|
committer | hashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-28 19:50:40 +0000 |
commit | 0736d9e6236381ca378e108fd4ba9d794c247a6e (patch) | |
tree | 0984ff7e6927fa95867cc77f48f88f2163b71012 /net/ocsp | |
parent | bf63a0c1e70c8973d24c9e2613e2e3adbb7f6b4b (diff) | |
download | chromium_src-0736d9e6236381ca378e108fd4ba9d794c247a6e.zip chromium_src-0736d9e6236381ca378e108fd4ba9d794c247a6e.tar.gz chromium_src-0736d9e6236381ca378e108fd4ba9d794c247a6e.tar.bz2 |
net: Move ownership of UploadDataStream from URLRequestHttpJob to URLRequest
URLRequest creates and owns UploadDataStream.
URLRequest::get_upload_mutable and URLRequest::AppendBytesToUpload are removed because they can modify UploadData after UploadDataStream is created.
Return type of URLRequest::get_upload is changed from UploadData to UploadDataStream.
A number of methods are added to UploadElementReader and its subclasses to support URLRequestAutomationJob and some other users.
BUG=156574
TEST=git try
TBR=jam@chromium.org (for chrome/browser/automation, already reviewed by ananta@chromium.org)
Review URL: https://chromiumcodereview.appspot.com/11419034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170028 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/ocsp')
-rw-r--r-- | net/ocsp/nss_ocsp.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/ocsp/nss_ocsp.cc b/net/ocsp/nss_ocsp.cc index 5412cba..3caff5d 100644 --- a/net/ocsp/nss_ocsp.cc +++ b/net/ocsp/nss_ocsp.cc @@ -33,6 +33,7 @@ #include "net/base/host_port_pair.h" #include "net/base/io_buffer.h" #include "net/base/load_flags.h" +#include "net/base/upload_data.h" #include "net/http/http_request_headers.h" #include "net/http/http_response_headers.h" #include "net/url_request/url_request.h" @@ -401,8 +402,10 @@ class OCSPRequestSession request_->set_method("POST"); extra_request_headers_.SetHeader( HttpRequestHeaders::kContentType, upload_content_type_); - request_->AppendBytesToUpload(upload_content_.data(), - static_cast<int>(upload_content_.size())); + + scoped_refptr<UploadData> upload_data(new UploadData()); + upload_data->AppendBytes(upload_content_.data(), upload_content_.size()); + request_->set_upload(upload_data); } if (!extra_request_headers_.IsEmpty()) request_->SetExtraRequestHeaders(extra_request_headers_); |