Index: net/url_request/url_request_simple_job.cc |
=================================================================== |
--- net/url_request/url_request_simple_job.cc (revision 147715) |
+++ net/url_request/url_request_simple_job.cc (working copy) |
@@ -57,13 +57,19 @@ |
if (!request_) |
return; |
- if (GetData(&mime_type_, &charset_, &data_)) { |
+ int result = GetData(&mime_type_, &charset_, &data_, |
+ base::Bind(&URLRequestSimpleJob::OnGetDataCompleted, |
+ weak_factory_.GetWeakPtr())); |
+ if (result != ERR_IO_PENDING) |
+ OnGetDataCompleted(result); |
+} |
+ |
+void URLRequestSimpleJob::OnGetDataCompleted(int result) { |
+ if (result == OK) { |
// Notify that the headers are complete |
NotifyHeadersComplete(); |
} else { |
- // what should the error code be? |
- NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, |
- ERR_INVALID_URL)); |
+ NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, result)); |
} |
} |