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

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 Created 4 years, 4 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
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..ff82eeeeaba17c7fb0eb6138c665274ba814a2ba 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);
}
@@ -318,12 +319,13 @@ class OCSPRequestSession
DCHECK_EQ(base::MessageLoopForIO::current(), io_loop_);
do {
- if (!request_->status().is_success() || bytes_read <= 0)
+ if (bytes_read <= 0)
break;
data_.append(buffer_->data(), bytes_read);
- } while (request_->Read(buffer_.get(), kRecvBufferSize, &bytes_read));
+ bytes_read = request_->Read(buffer_.get(), kRecvBufferSize);
+ } while (bytes_read > 0);
mmenke 2016/08/30 22:13:22 This final while condition is no longer needed. T
maksims (do not use this acc) 2016/09/01 12:22:29 Done!
- if (!request_->status().is_io_pending()) {
+ if (bytes_read != ERR_IO_PENDING) {
request_.reset();
g_ocsp_io_loop.Get().RemoveRequest(this);
{

Powered by Google App Engine
This is Rietveld 408576698