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_->RecordNegotiationExtension(); |
| 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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 CHECK(it != messenger_map_.end()); | 844 CHECK(it != messenger_map_.end()); |
843 delete it->second; | 845 delete it->second; |
844 messenger_map_.erase(it); | 846 messenger_map_.erase(it); |
845 } | 847 } |
846 | 848 |
847 void SSLClientSocketPool::OnSSLConfigChanged() { | 849 void SSLClientSocketPool::OnSSLConfigChanged() { |
848 FlushWithError(ERR_NETWORK_CHANGED); | 850 FlushWithError(ERR_NETWORK_CHANGED); |
849 } | 851 } |
850 | 852 |
851 } // namespace net | 853 } // namespace net |
OLD | NEW |