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

Unified Diff: remoting/host/token_validator_base.cc

Issue 2542843006: ResourceLoader: Fix a bunch of double-cancellation/double-error notification cases. (Closed)
Patch Set: Inline ReadMore Created 4 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
Index: remoting/host/token_validator_base.cc
diff --git a/remoting/host/token_validator_base.cc b/remoting/host/token_validator_base.cc
index 852879f77b8ec5d1715332c6b78a1efcc8df9aae..dbd84b55619f1787504287dd8159386e1501a079 100644
--- a/remoting/host/token_validator_base.cc
+++ b/remoting/host/token_validator_base.cc
@@ -127,11 +127,14 @@ void TokenValidatorBase::OnResponseStarted(net::URLRequest* source,
DCHECK_NE(net_result, net::ERR_IO_PENDING);
DCHECK_EQ(request_.get(), source);
- if (net_result != net::OK)
+ if (net_result != net::OK) {
+ // Treat all network errors read errors.
+ OnReadCompleted(request_.get(), net_result);
mmenke 2016/12/02 15:20:08 This is a bug fix.
return;
+ }
int bytes_read = request_->Read(buffer_.get(), kBufferSize);
- if (bytes_read > 0)
+ if (bytes_read != net::ERR_IO_PENDING)
mmenke 2016/12/02 15:20:08 Note that doing this in the bytes_read == 0 case i
OnReadCompleted(request_.get(), bytes_read);
}

Powered by Google App Engine
This is Rietveld 408576698