Index: net/url_request/url_request.cc |
=================================================================== |
--- net/url_request/url_request.cc (revision 9239) |
+++ net/url_request/url_request.cc (working copy) |
@@ -234,10 +234,6 @@ |
void URLRequest::CancelWithError(int os_error) { |
DCHECK(os_error < 0); |
- // There's nothing to do if we are not waiting on a Job. |
- if (!is_pending_ || !job_) |
- return; |
- |
// If the URL request already has an error status, then canceling is a no-op. |
// Plus, we don't want to change the error status once it has been set. |
if (status_.is_success()) { |
@@ -245,6 +241,10 @@ |
status_.set_os_error(os_error); |
} |
+ // There's nothing to do if we are not waiting on a Job. |
+ if (!is_pending_ || !job_) |
+ return; |
+ |
job_->Kill(); |
// The Job will call our NotifyDone method asynchronously. This is done so |
@@ -350,7 +350,7 @@ |
method_ = "GET"; |
} |
url_ = location; |
- upload_ = 0; |
+ upload_ = NULL; |
status_ = URLRequestStatus(); |
--redirect_limit_; |