Chromium Code Reviews| 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 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1076 } | 1076 } |
| 1077 } | 1077 } |
| 1078 if (transaction_ && transaction_->GetResponseInfo()) { | 1078 if (transaction_ && transaction_->GetResponseInfo()) { |
| 1079 LogChannelIDAndCookieStores(request_->url(), request_->context(), | 1079 LogChannelIDAndCookieStores(request_->url(), request_->context(), |
| 1080 transaction_->GetResponseInfo()->ssl_info); | 1080 transaction_->GetResponseInfo()->ssl_info); |
| 1081 } | 1081 } |
| 1082 | 1082 |
| 1083 SaveCookiesAndNotifyHeadersComplete(OK); | 1083 SaveCookiesAndNotifyHeadersComplete(OK); |
| 1084 } else if (IsCertificateError(result)) { | 1084 } else if (IsCertificateError(result)) { |
| 1085 // We encountered an SSL certificate error. | 1085 // We encountered an SSL certificate error. |
| 1086 if (result == ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY || | 1086 // Maybe overridable, maybe not. Ask the delegate to decide. |
| 1087 result == ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN) { | 1087 TransportSecurityState* state = context->transport_security_state(); |
|
estark
2016/06/21 00:29:24
Is this guaranteed to be non-null? The old code ha
Ryan Sleevi
2016/06/21 00:39:04
Yes. See the CL this depends on
In particular, ht
estark
2016/06/21 00:49:06
Ahh, I see, I missed that that had landed. Thanks.
| |
| 1088 // These are hard failures. They're handled separately and don't have | 1088 NotifySSLCertificateError( |
| 1089 // the correct cert status, so set it here. | 1089 transaction_->GetResponseInfo()->ssl_info, |
| 1090 SSLInfo info(transaction_->GetResponseInfo()->ssl_info); | 1090 state->ShouldSSLErrorsBeFatal(request_info_.url.host())); |
| 1091 info.cert_status = MapNetErrorToCertStatus(result); | |
| 1092 NotifySSLCertificateError(info, true); | |
| 1093 } else { | |
| 1094 // Maybe overridable, maybe not. Ask the delegate to decide. | |
| 1095 TransportSecurityState* state = context->transport_security_state(); | |
| 1096 const bool fatal = | |
| 1097 state && state->ShouldSSLErrorsBeFatal(request_info_.url.host()); | |
| 1098 NotifySSLCertificateError( | |
| 1099 transaction_->GetResponseInfo()->ssl_info, fatal); | |
| 1100 } | |
| 1101 } else if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) { | 1091 } else if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) { |
| 1102 NotifyCertificateRequested( | 1092 NotifyCertificateRequested( |
| 1103 transaction_->GetResponseInfo()->cert_request_info.get()); | 1093 transaction_->GetResponseInfo()->cert_request_info.get()); |
| 1104 } else { | 1094 } else { |
| 1105 // Even on an error, there may be useful information in the response | 1095 // Even on an error, there may be useful information in the response |
| 1106 // info (e.g. whether there's a cached copy). | 1096 // info (e.g. whether there's a cached copy). |
| 1107 if (transaction_.get()) | 1097 if (transaction_.get()) |
| 1108 response_info_ = transaction_->GetResponseInfo(); | 1098 response_info_ = transaction_->GetResponseInfo(); |
| 1109 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, result)); | 1099 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, result)); |
| 1110 } | 1100 } |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1688 // Notify NetworkQualityEstimator. | 1678 // Notify NetworkQualityEstimator. |
| 1689 if (request()) { | 1679 if (request()) { |
| 1690 NetworkQualityEstimator* network_quality_estimator = | 1680 NetworkQualityEstimator* network_quality_estimator = |
| 1691 request()->context()->network_quality_estimator(); | 1681 request()->context()->network_quality_estimator(); |
| 1692 if (network_quality_estimator) | 1682 if (network_quality_estimator) |
| 1693 network_quality_estimator->NotifyURLRequestDestroyed(*request()); | 1683 network_quality_estimator->NotifyURLRequestDestroyed(*request()); |
| 1694 } | 1684 } |
| 1695 } | 1685 } |
| 1696 | 1686 |
| 1697 } // namespace net | 1687 } // namespace net |
| OLD | NEW |