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

Unified Diff: remoting/host/token_validator_base.cc

Issue 2542843006: ResourceLoader: Fix a bunch of double-cancellation/double-error notification cases. (Closed)
Patch Set: Fix merge 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
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | remoting/host/token_validator_factory_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d461b578b03bbec2e3db52df3628f0d2090dd283 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) {
+ // Process all network errors in the same manner as read errors.
+ OnReadCompleted(request_.get(), net_result);
return;
+ }
int bytes_read = request_->Read(buffer_.get(), kBufferSize);
- if (bytes_read > 0)
+ if (bytes_read != net::ERR_IO_PENDING)
OnReadCompleted(request_.get(), bytes_read);
}
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | remoting/host/token_validator_factory_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698