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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 return; | 728 return; |
729 } | 729 } |
730 } | 730 } |
731 | 731 |
732 SaveCookiesAndNotifyHeadersComplete(net::OK); | 732 SaveCookiesAndNotifyHeadersComplete(net::OK); |
733 } else if (IsCertificateError(result)) { | 733 } else if (IsCertificateError(result)) { |
734 // We encountered an SSL certificate error. Ask our delegate to decide | 734 // We encountered an SSL certificate error. Ask our delegate to decide |
735 // what we should do. | 735 // what we should do. |
736 | 736 |
737 TransportSecurityState::DomainState domain_state; | 737 TransportSecurityState::DomainState domain_state; |
738 const bool is_hsts_host = | 738 const bool fatal = |
739 context_->transport_security_state() && | 739 context_->transport_security_state() && |
740 context_->transport_security_state()->GetDomainState( | 740 context_->transport_security_state()->GetDomainState( |
741 &domain_state, request_info_.url.host(), | 741 &domain_state, request_info_.url.host(), |
742 SSLConfigService::IsSNIAvailable(context_->ssl_config_service())); | 742 SSLConfigService::IsSNIAvailable(context_->ssl_config_service())); |
743 NotifySSLCertificateError(transaction_->GetResponseInfo()->ssl_info, | 743 NotifySSLCertificateError(transaction_->GetResponseInfo()->ssl_info, fatal); |
744 is_hsts_host); | |
745 } else if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) { | 744 } else if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) { |
746 NotifyCertificateRequested( | 745 NotifyCertificateRequested( |
747 transaction_->GetResponseInfo()->cert_request_info); | 746 transaction_->GetResponseInfo()->cert_request_info); |
748 } else { | 747 } else { |
749 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, result)); | 748 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, result)); |
750 } | 749 } |
751 } | 750 } |
752 | 751 |
753 void URLRequestHttpJob::OnHeadersReceivedCallback(int result) { | 752 void URLRequestHttpJob::OnHeadersReceivedCallback(int result) { |
754 request_->net_log().EndEvent( | 753 request_->net_log().EndEvent( |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1445 return override_response_headers_.get() ? | 1444 return override_response_headers_.get() ? |
1446 override_response_headers_ : | 1445 override_response_headers_ : |
1447 transaction_->GetResponseInfo()->headers; | 1446 transaction_->GetResponseInfo()->headers; |
1448 } | 1447 } |
1449 | 1448 |
1450 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1449 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
1451 awaiting_callback_ = false; | 1450 awaiting_callback_ = false; |
1452 } | 1451 } |
1453 | 1452 |
1454 } // namespace net | 1453 } // namespace net |
OLD | NEW |