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);
}
diff --git a/net/url_request/url_request_job.cc b/net/url_request/url_request_job.cc
index bd7141c6..3af22b7 100644
--- a/net/url_request/url_request_job.cc
+++ b/net/url_request/url_request_job.cc
@@ -589,10 +589,6 @@
return std::make_unique<URLRequestJobSourceStream>(this);
}
-const URLRequestStatus URLRequestJob::GetStatus() {
- return request_->status();
-}
-
void URLRequestJob::SetProxyServer(const ProxyServer& proxy_server) {
request_->proxy_server_ = proxy_server;
}
diff --git a/net/url_request/url_request_job.h b/net/url_request/url_request_job.h
index 52d355ba..013471a 100644
--- a/net/url_request/url_request_job.h
+++ b/net/url_request/url_request_job.h
@@ -325,9 +325,6 @@
// Provides derived classes with access to the request's network delegate.
NetworkDelegate* network_delegate() { return network_delegate_; }
- // The status of the job.
- const URLRequestStatus GetStatus();
-
// Set the proxy server that was used, if any.
void SetProxyServer(const ProxyServer& proxy_server);