| 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/socket/ssl_client_socket_pool.h" | 5 #include "net/socket/ssl_client_socket_pool.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 | 445 |
| 446 int SSLConnectJob::DoSSLConnectComplete(int result) { | 446 int SSLConnectJob::DoSSLConnectComplete(int result) { |
| 447 connect_timing_.ssl_end = base::TimeTicks::Now(); | 447 connect_timing_.ssl_end = base::TimeTicks::Now(); |
| 448 | 448 |
| 449 SSLClientSocket::NextProtoStatus status = | 449 SSLClientSocket::NextProtoStatus status = |
| 450 SSLClientSocket::kNextProtoUnsupported; | 450 SSLClientSocket::kNextProtoUnsupported; |
| 451 std::string proto; | 451 std::string proto; |
| 452 // GetNextProto will fail and and trigger a NOTREACHED if we pass in a socket | 452 // GetNextProto will fail and and trigger a NOTREACHED if we pass in a socket |
| 453 // that hasn't had SSL_ImportFD called on it. If we get a certificate error | 453 // that hasn't had SSL_ImportFD called on it. If we get a certificate error |
| 454 // here, then we know that we called SSL_ImportFD. | 454 // here, then we know that we called SSL_ImportFD. |
| 455 if (result == OK || IsCertificateError(result)) | 455 if (result == OK || IsCertificateError(result)) { |
| 456 status = ssl_socket_->GetNextProto(&proto); | 456 status = ssl_socket_->GetNextProto(&proto); |
| 457 ssl_socket_->RecordProtocolNegotiation(); |
| 458 } |
| 457 | 459 |
| 458 // If we want spdy over npn, make sure it succeeded. | 460 // If we want spdy over npn, make sure it succeeded. |
| 459 if (status == SSLClientSocket::kNextProtoNegotiated) { | 461 if (status == SSLClientSocket::kNextProtoNegotiated) { |
| 460 ssl_socket_->set_was_npn_negotiated(true); | 462 ssl_socket_->set_was_npn_negotiated(true); |
| 461 NextProto protocol_negotiated = | 463 NextProto protocol_negotiated = |
| 462 SSLClientSocket::NextProtoFromString(proto); | 464 SSLClientSocket::NextProtoFromString(proto); |
| 463 ssl_socket_->set_protocol_negotiated(protocol_negotiated); | 465 ssl_socket_->set_protocol_negotiated(protocol_negotiated); |
| 464 // If we negotiated a SPDY version, it must have been present in | 466 // If we negotiated a SPDY version, it must have been present in |
| 465 // SSLConfig::next_protos. | 467 // SSLConfig::next_protos. |
| 466 // TODO(mbelshe): Verify this. | 468 // TODO(mbelshe): Verify this. |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 CHECK(it != messenger_map_.end()); | 856 CHECK(it != messenger_map_.end()); |
| 855 delete it->second; | 857 delete it->second; |
| 856 messenger_map_.erase(it); | 858 messenger_map_.erase(it); |
| 857 } | 859 } |
| 858 | 860 |
| 859 void SSLClientSocketPool::OnSSLConfigChanged() { | 861 void SSLClientSocketPool::OnSSLConfigChanged() { |
| 860 FlushWithError(ERR_NETWORK_CHANGED); | 862 FlushWithError(ERR_NETWORK_CHANGED); |
| 861 } | 863 } |
| 862 | 864 |
| 863 } // namespace net | 865 } // namespace net |
| OLD | NEW |