| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 | 329 |
| 330 connect_timing_.ssl_end = base::TimeTicks::Now(); | 330 connect_timing_.ssl_end = base::TimeTicks::Now(); |
| 331 | 331 |
| 332 if (result != OK && !server_address_.address().empty()) { | 332 if (result != OK && !server_address_.address().empty()) { |
| 333 connection_attempts_.push_back(ConnectionAttempt(server_address_, result)); | 333 connection_attempts_.push_back(ConnectionAttempt(server_address_, result)); |
| 334 server_address_ = IPEndPoint(); | 334 server_address_ = IPEndPoint(); |
| 335 } | 335 } |
| 336 | 336 |
| 337 // If we want SPDY over ALPN/NPN, make sure it succeeded. | 337 // If we want SPDY over ALPN/NPN, make sure it succeeded. |
| 338 if (params_->expect_spdy() && | 338 if (params_->expect_spdy() && |
| 339 !NextProtoIsSPDY(ssl_socket_->GetNegotiatedProtocol())) { | 339 ssl_socket_->GetNegotiatedProtocol() != kProtoHTTP2) { |
| 340 return ERR_NPN_NEGOTIATION_FAILED; | 340 return ERR_NPN_NEGOTIATION_FAILED; |
| 341 } | 341 } |
| 342 | 342 |
| 343 if (result == OK || | 343 if (result == OK || |
| 344 ssl_socket_->IgnoreCertError(result, params_->load_flags())) { | 344 ssl_socket_->IgnoreCertError(result, params_->load_flags())) { |
| 345 DCHECK(!connect_timing_.ssl_start.is_null()); | 345 DCHECK(!connect_timing_.ssl_start.is_null()); |
| 346 base::TimeDelta connect_duration = | 346 base::TimeDelta connect_duration = |
| 347 connect_timing_.ssl_end - connect_timing_.ssl_start; | 347 connect_timing_.ssl_end - connect_timing_.ssl_start; |
| 348 if (params_->expect_spdy()) { | 348 if (params_->expect_spdy()) { |
| 349 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SpdyConnectionLatency_2", | 349 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SpdyConnectionLatency_2", |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 if (base_.CloseOneIdleSocket()) | 670 if (base_.CloseOneIdleSocket()) |
| 671 return true; | 671 return true; |
| 672 return base_.CloseOneIdleConnectionInHigherLayeredPool(); | 672 return base_.CloseOneIdleConnectionInHigherLayeredPool(); |
| 673 } | 673 } |
| 674 | 674 |
| 675 void SSLClientSocketPool::OnSSLConfigChanged() { | 675 void SSLClientSocketPool::OnSSLConfigChanged() { |
| 676 FlushWithError(ERR_NETWORK_CHANGED); | 676 FlushWithError(ERR_NETWORK_CHANGED); |
| 677 } | 677 } |
| 678 | 678 |
| 679 } // namespace net | 679 } // namespace net |
| OLD | NEW |