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

Unified Diff: net/url_request/url_request.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 | « content/browser/loader/test_resource_handler.cc ('k') | net/url_request/url_request_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request.cc
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index eb4be23b475ae449ceb99622e739704d1c160304..75eb4220106fe424eb49df9492143b2558913953 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -762,14 +762,14 @@ int URLRequest::Read(IOBuffer* dest, int dest_size) {
}
int rv = job_->Read(dest, dest_size);
- if (rv == ERR_IO_PENDING)
+ if (rv == ERR_IO_PENDING) {
set_status(URLRequestStatus::FromError(ERR_IO_PENDING));
+ } else if (rv <= 0) {
+ NotifyRequestCompleted();
+ }
// If rv is not 0 or actual bytes read, the status cannot be success.
DCHECK(rv >= 0 || status_.status() != URLRequestStatus::SUCCESS);
-
- if (rv == 0 && status_.is_success())
- NotifyRequestCompleted();
return rv;
}
« no previous file with comments | « content/browser/loader/test_resource_handler.cc ('k') | net/url_request/url_request_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698