Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2452)

Unified Diff: net/url_request/url_request_job.cc

Issue 2676033002: Give URLRequestJob::GetResponseCode a better default implementation. (Closed)
Patch Set: Add headers Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/url_request/test_url_request_interceptor.cc ('k') | net/url_request/url_request_redirect_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_job.cc
diff --git a/net/url_request/url_request_job.cc b/net/url_request/url_request_job.cc
index cdf60f80fdad3d001ad68fd39eaae9af4b98e1d2..464e920fbef71ed6536dc0b89fb0efed08f68041 100644
--- a/net/url_request/url_request_job.cc
+++ b/net/url_request/url_request_job.cc
@@ -334,7 +334,10 @@ bool URLRequestJob::GetMimeType(std::string* mime_type) const {
}
int URLRequestJob::GetResponseCode() const {
- return -1;
+ HttpResponseHeaders* headers = request_->response_headers();
+ if (!headers)
+ return -1;
+ return headers->response_code();
}
HostPortPair URLRequestJob::GetSocketAddress() const {
« no previous file with comments | « net/url_request/test_url_request_interceptor.cc ('k') | net/url_request/url_request_redirect_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698