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

Unified Diff: net/cert_net/nss_ocsp.cc

Issue 2265873002: Adjust callers and networking delegates in net/ to modified APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@URLRequestRead
Patch Set: rebased on top of URLRequest::Read CL Created 4 years, 3 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
« no previous file with comments | « net/cert_net/cert_net_fetcher_impl.cc ('k') | net/nqe/network_quality_estimator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert_net/nss_ocsp.cc
diff --git a/net/cert_net/nss_ocsp.cc b/net/cert_net/nss_ocsp.cc
index 46000565fe1eeae65f216f386aedfcc38709e896..0eb4678434b247866712812c4e54be2ef1f9719c 100644
--- a/net/cert_net/nss_ocsp.cc
+++ b/net/cert_net/nss_ocsp.cc
@@ -299,16 +299,17 @@ class OCSPRequestSession
}
}
- void OnResponseStarted(URLRequest* request) override {
+ void OnResponseStarted(URLRequest* request, int net_error) override {
DCHECK_EQ(request_.get(), request);
DCHECK_EQ(base::MessageLoopForIO::current(), io_loop_);
+ DCHECK_NE(ERR_IO_PENDING, net_error);
int bytes_read = 0;
- if (request->status().is_success()) {
+ if (net_error == OK) {
response_code_ = request_->GetResponseCode();
response_headers_ = request_->response_headers();
response_headers_->GetMimeType(&response_content_type_);
- request_->Read(buffer_.get(), kRecvBufferSize, &bytes_read);
+ bytes_read = request_->Read(buffer_.get(), kRecvBufferSize);
}
OnReadCompleted(request_.get(), bytes_read);
}
@@ -317,13 +318,12 @@ class OCSPRequestSession
DCHECK_EQ(request_.get(), request);
DCHECK_EQ(base::MessageLoopForIO::current(), io_loop_);
- do {
- if (!request_->status().is_success() || bytes_read <= 0)
- break;
+ while (bytes_read > 0) {
data_.append(buffer_->data(), bytes_read);
- } while (request_->Read(buffer_.get(), kRecvBufferSize, &bytes_read));
+ bytes_read = request_->Read(buffer_.get(), kRecvBufferSize);
+ }
- if (!request_->status().is_io_pending()) {
+ if (bytes_read != ERR_IO_PENDING) {
request_.reset();
g_ocsp_io_loop.Get().RemoveRequest(this);
{
« no previous file with comments | « net/cert_net/cert_net_fetcher_impl.cc ('k') | net/nqe/network_quality_estimator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698