Remove URLRequestHttpGet::GetStatus().
It was only used by a pair of DCHECKs that can check if the job is
"done" instead. Done includes cancellation, but also other completion
reasons, which is actually a better thing to check at the old callsites.
This is part of an effort to remove URLRequestStatus.
Bug: 651119
Change-Id: I99454888368c7b5aa320153e1911dfa3230923f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2164690
Reviewed-by: Eric Roman <[email protected]>
Commit-Queue: Matt Menke <[email protected]>
Cr-Commit-Position: refs/heads/master@{#763001}
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index 380e050..511c37b 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -390,8 +390,8 @@
}
void URLRequestHttpJob::NotifyBeforeStartTransactionCallback(int result) {
- // Check that there are no callbacks to already canceled requests.
- DCHECK_NE(URLRequestStatus::CANCELED, GetStatus().status());
+ // The request should not have been cancelled or have already completed.
+ DCHECK(!is_done());
MaybeStartTransactionInternal(result);
}
@@ -906,10 +906,10 @@
}
void URLRequestHttpJob::OnHeadersReceivedCallback(int result) {
- awaiting_callback_ = false;
+ // The request should not have been cancelled or have already completed.
+ DCHECK(!is_done());
- // Check that there are no callbacks to already canceled requests.
- DCHECK_NE(URLRequestStatus::CANCELED, GetStatus().status());
+ awaiting_callback_ = false;
SaveCookiesAndNotifyHeadersComplete(result);
}