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

Unified Diff: net/url_request/url_request_file_job.cc

Issue 266963003: Beginning of support for extension content verification (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged latest trunk Created 6 years, 7 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/url_request/url_request_file_job.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_file_job.cc
diff --git a/net/url_request/url_request_file_job.cc b/net/url_request/url_request_file_job.cc
index 011a0daff23c8dee4617734d3148a05592c8c364..74e61315980c0238c6795ef55acf2e03d86722bf 100644
--- a/net/url_request/url_request_file_job.cc
+++ b/net/url_request/url_request_file_job.cc
@@ -294,19 +294,21 @@ void URLRequestFileJob::DidSeek(int64 result) {
}
void URLRequestFileJob::DidRead(scoped_refptr<net::IOBuffer> buf, int result) {
- OnReadComplete(buf.get(), result);
- buf = NULL;
if (result > 0) {
SetStatus(URLRequestStatus()); // Clear the IO_PENDING status
- } else if (result == 0) {
+ remaining_bytes_ -= result;
+ DCHECK_GE(remaining_bytes_, 0);
+ }
+
+ OnReadComplete(buf.get(), result);
+ buf = NULL;
+
+ if (result == 0) {
NotifyDone(URLRequestStatus());
- } else {
+ } else if (result < 0) {
NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, result));
}
- remaining_bytes_ -= result;
- DCHECK_GE(remaining_bytes_, 0);
-
NotifyReadComplete(result);
}
« no previous file with comments | « net/url_request/url_request_file_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698