| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/http/http_stream_factory_impl_job.h" | 5 #include "net/http/http_stream_factory_impl_job.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stl_util-inl.h" | 8 #include "base/stl_util-inl.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1081 | 1081 |
| 1082 int HttpStreamFactoryImpl::Job::HandleCertificateError(int error) { | 1082 int HttpStreamFactoryImpl::Job::HandleCertificateError(int error) { |
| 1083 DCHECK(using_ssl_); | 1083 DCHECK(using_ssl_); |
| 1084 DCHECK(IsCertificateError(error)); | 1084 DCHECK(IsCertificateError(error)); |
| 1085 | 1085 |
| 1086 SSLClientSocket* ssl_socket = | 1086 SSLClientSocket* ssl_socket = |
| 1087 static_cast<SSLClientSocket*>(connection_->socket()); | 1087 static_cast<SSLClientSocket*>(connection_->socket()); |
| 1088 ssl_socket->GetSSLInfo(&ssl_info_); | 1088 ssl_socket->GetSSLInfo(&ssl_info_); |
| 1089 | 1089 |
| 1090 // Add the bad certificate to the set of allowed certificates in the | 1090 // Add the bad certificate to the set of allowed certificates in the |
| 1091 // SSL info object. This data structure will be consulted after calling | 1091 // SSL config object. This data structure will be consulted after calling |
| 1092 // RestartIgnoringLastError(). And the user will be asked interactively | 1092 // RestartIgnoringLastError(). And the user will be asked interactively |
| 1093 // before RestartIgnoringLastError() is ever called. | 1093 // before RestartIgnoringLastError() is ever called. |
| 1094 SSLConfig::CertAndStatus bad_cert; | 1094 SSLConfig::CertAndStatus bad_cert; |
| 1095 bad_cert.cert = ssl_info_.cert; | 1095 bad_cert.cert = ssl_info_.cert; |
| 1096 bad_cert.cert_status = ssl_info_.cert_status; | 1096 bad_cert.cert_status = ssl_info_.cert_status; |
| 1097 ssl_config_.allowed_bad_certs.push_back(bad_cert); | 1097 ssl_config_.allowed_bad_certs.push_back(bad_cert); |
| 1098 | 1098 |
| 1099 int load_flags = request_info_.load_flags; | 1099 int load_flags = request_info_.load_flags; |
| 1100 if (HttpStreamFactory::ignore_certificate_errors()) | 1100 if (HttpStreamFactory::ignore_certificate_errors()) |
| 1101 load_flags |= LOAD_IGNORE_ALL_CERT_ERRORS; | 1101 load_flags |= LOAD_IGNORE_ALL_CERT_ERRORS; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1146 bool HttpStreamFactoryImpl::Job::IsPreconnecting() const { | 1146 bool HttpStreamFactoryImpl::Job::IsPreconnecting() const { |
| 1147 DCHECK_GE(num_streams_, 0); | 1147 DCHECK_GE(num_streams_, 0); |
| 1148 return num_streams_ > 0; | 1148 return num_streams_ > 0; |
| 1149 } | 1149 } |
| 1150 | 1150 |
| 1151 bool HttpStreamFactoryImpl::Job::IsOrphaned() const { | 1151 bool HttpStreamFactoryImpl::Job::IsOrphaned() const { |
| 1152 return !IsPreconnecting() && !request_; | 1152 return !IsPreconnecting() && !request_; |
| 1153 } | 1153 } |
| 1154 | 1154 |
| 1155 } // namespace net | 1155 } // namespace net |
| OLD | NEW |