OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/url_request/url_request_http_job.h" | 5 #include "net/url_request/url_request_http_job.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 const HttpRequestHeaders& headers) { | 1081 const HttpRequestHeaders& headers) { |
1082 DCHECK(!transaction_.get()) << "cannot change once started"; | 1082 DCHECK(!transaction_.get()) << "cannot change once started"; |
1083 request_info_.extra_headers.CopyFrom(headers); | 1083 request_info_.extra_headers.CopyFrom(headers); |
1084 } | 1084 } |
1085 | 1085 |
1086 LoadState URLRequestHttpJob::GetLoadState() const { | 1086 LoadState URLRequestHttpJob::GetLoadState() const { |
1087 return transaction_.get() ? | 1087 return transaction_.get() ? |
1088 transaction_->GetLoadState() : LOAD_STATE_IDLE; | 1088 transaction_->GetLoadState() : LOAD_STATE_IDLE; |
1089 } | 1089 } |
1090 | 1090 |
1091 UploadProgress URLRequestHttpJob::GetUploadProgress() const { | |
1092 return transaction_.get() ? | |
1093 transaction_->GetUploadProgress() : UploadProgress(); | |
1094 } | |
1095 | |
1096 bool URLRequestHttpJob::GetMimeType(std::string* mime_type) const { | 1091 bool URLRequestHttpJob::GetMimeType(std::string* mime_type) const { |
1097 DCHECK(transaction_.get()); | 1092 DCHECK(transaction_.get()); |
1098 | 1093 |
1099 if (!response_info_) | 1094 if (!response_info_) |
1100 return false; | 1095 return false; |
1101 | 1096 |
1102 HttpResponseHeaders* headers = GetResponseHeaders(); | 1097 HttpResponseHeaders* headers = GetResponseHeaders(); |
1103 if (!headers) | 1098 if (!headers) |
1104 return false; | 1099 return false; |
1105 return headers->GetMimeType(mime_type); | 1100 return headers->GetMimeType(mime_type); |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1609 // Notify NetworkQualityEstimator. | 1604 // Notify NetworkQualityEstimator. |
1610 if (request()) { | 1605 if (request()) { |
1611 NetworkQualityEstimator* network_quality_estimator = | 1606 NetworkQualityEstimator* network_quality_estimator = |
1612 request()->context()->network_quality_estimator(); | 1607 request()->context()->network_quality_estimator(); |
1613 if (network_quality_estimator) | 1608 if (network_quality_estimator) |
1614 network_quality_estimator->NotifyURLRequestDestroyed(*request()); | 1609 network_quality_estimator->NotifyURLRequestDestroyed(*request()); |
1615 } | 1610 } |
1616 } | 1611 } |
1617 | 1612 |
1618 } // namespace net | 1613 } // namespace net |
OLD | NEW |