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

Unified Diff: net/ocsp/nss_ocsp.cc

Issue 11439008: net: Change argument of URLRequest::set_upload from UploadData to UploadDataStream (Closed) Base URL: http://git.chromium.org/chromium/src.git@chunk
Patch Set: Fix android Created 8 years 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_file_element_reader.h ('k') | net/test/spawner_communicator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ocsp/nss_ocsp.cc
diff --git a/net/ocsp/nss_ocsp.cc b/net/ocsp/nss_ocsp.cc
index 3caff5d31bbf4f24dd0f01e4b23799cd6dee362f..f1228414e7a005862c31e54defcf5fde1e68e76f 100644
--- a/net/ocsp/nss_ocsp.cc
+++ b/net/ocsp/nss_ocsp.cc
@@ -33,7 +33,8 @@
#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/base/upload_bytes_element_reader.h"
+#include "net/base/upload_data_stream.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request.h"
@@ -190,6 +191,8 @@ class OCSPRequestSession
void SetPostData(const char* http_data, PRUint32 http_data_len,
const char* http_content_type) {
+ // |upload_content_| should not be modified if |request_| is active.
+ DCHECK(!request_);
upload_content_.assign(http_data, http_data_len);
upload_content_type_.assign(http_content_type);
}
@@ -403,9 +406,10 @@ class OCSPRequestSession
extra_request_headers_.SetHeader(
HttpRequestHeaders::kContentType, upload_content_type_);
- scoped_refptr<UploadData> upload_data(new UploadData());
- upload_data->AppendBytes(upload_content_.data(), upload_content_.size());
- request_->set_upload(upload_data);
+ scoped_ptr<UploadElementReader> reader(new UploadBytesElementReader(
+ upload_content_.data(), upload_content_.size()));
+ request_->set_upload(make_scoped_ptr(
+ UploadDataStream::CreateWithReader(reader.Pass(), 0)));
}
if (!extra_request_headers_.IsEmpty())
request_->SetExtraRequestHeaders(extra_request_headers_);
@@ -420,7 +424,9 @@ class OCSPRequestSession
URLRequest* request_; // The actual request this wraps
scoped_refptr<IOBuffer> buffer_; // Read buffer
HttpRequestHeaders extra_request_headers_;
- std::string upload_content_; // HTTP POST payload
+
+ // HTTP POST payload. |request_| reads bytes from this.
+ std::string upload_content_;
std::string upload_content_type_; // MIME type of POST payload
int response_code_; // HTTP status code for the request
« no previous file with comments | « net/base/upload_file_element_reader.h ('k') | net/test/spawner_communicator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698