| Index: net/url_request/url_request.cc
|
| diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
|
| index fef10fbdb0b4bd2bea18f1c0f110eff6f0ed8c60..85fcbdfd0f2ffa71e87147837aa05f9d1556089e 100644
|
| --- a/net/url_request/url_request.cc
|
| +++ b/net/url_request/url_request.cc
|
| @@ -478,30 +478,38 @@ void URLRequest::RestartWithJob(URLRequestJob *job) {
|
| }
|
|
|
| void URLRequest::Cancel() {
|
| - DoCancel(ERR_ABORTED, SSLInfo());
|
| + DoCancel(URLRequestStatus(URLRequestStatus::CANCELED, ERR_ABORTED),
|
| + SSLInfo());
|
| }
|
|
|
| void URLRequest::CancelWithError(int error) {
|
| - DoCancel(error, SSLInfo());
|
| + DCHECK(error < 0);
|
| + DoCancel(URLRequestStatus(URLRequestStatus::CANCELED, error),
|
| + SSLInfo());
|
| }
|
|
|
| void URLRequest::CancelWithSSLError(int error, const SSLInfo& ssl_info) {
|
| + DCHECK(error < 0);
|
| // This should only be called on a started request.
|
| if (!is_pending_ || !job_ || job_->has_response_started()) {
|
| NOTREACHED();
|
| return;
|
| }
|
| - DoCancel(error, ssl_info);
|
| + DoCancel(URLRequestStatus(URLRequestStatus::CANCELED, error),
|
| + SSLInfo());
|
| }
|
|
|
| -void URLRequest::DoCancel(int error, const SSLInfo& ssl_info) {
|
| - DCHECK(error < 0);
|
| +void URLRequest::CancelWithHandledExternallyStatus() {
|
| + DoCancel(URLRequestStatus(URLRequestStatus::HANDLED_EXTERNALLY, OK),
|
| + SSLInfo());
|
| +}
|
|
|
| +void URLRequest::DoCancel(const URLRequestStatus& status,
|
| + const SSLInfo& ssl_info) {
|
| // 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()) {
|
| - status_.set_status(URLRequestStatus::CANCELED);
|
| - status_.set_error(error);
|
| + status_ = status;
|
| response_info_.ssl_info = ssl_info;
|
| }
|
|
|
|
|