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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 if (status == SSLClientSocket::kNextProtoNegotiated) { | 296 if (status == SSLClientSocket::kNextProtoNegotiated) { |
297 ssl_socket_->set_was_npn_negotiated(true); | 297 ssl_socket_->set_was_npn_negotiated(true); |
298 SSLClientSocket::NextProto protocol_negotiated = | 298 SSLClientSocket::NextProto protocol_negotiated = |
299 SSLClientSocket::NextProtoFromString(proto); | 299 SSLClientSocket::NextProtoFromString(proto); |
300 ssl_socket_->set_protocol_negotiated(protocol_negotiated); | 300 ssl_socket_->set_protocol_negotiated(protocol_negotiated); |
301 // If we negotiated either version of SPDY, we must have | 301 // If we negotiated either version of SPDY, we must have |
302 // advertised it, so allow it. | 302 // advertised it, so allow it. |
303 // TODO(mbelshe): verify it was a protocol we advertised? | 303 // TODO(mbelshe): verify it was a protocol we advertised? |
304 if (protocol_negotiated == SSLClientSocket::kProtoSPDY1 || | 304 if (protocol_negotiated == SSLClientSocket::kProtoSPDY1 || |
305 protocol_negotiated == SSLClientSocket::kProtoSPDY2 || | 305 protocol_negotiated == SSLClientSocket::kProtoSPDY2 || |
306 protocol_negotiated == SSLClientSocket::kProtoSPDY21) { | 306 protocol_negotiated == SSLClientSocket::kProtoSPDY21 || |
| 307 protocol_negotiated == SSLClientSocket::kProtoSPDY3) { |
307 ssl_socket_->set_was_spdy_negotiated(true); | 308 ssl_socket_->set_was_spdy_negotiated(true); |
308 } | 309 } |
309 } | 310 } |
310 if (params_->want_spdy_over_npn() && !ssl_socket_->was_spdy_negotiated()) | 311 if (params_->want_spdy_over_npn() && !ssl_socket_->was_spdy_negotiated()) |
311 return ERR_NPN_NEGOTIATION_FAILED; | 312 return ERR_NPN_NEGOTIATION_FAILED; |
312 | 313 |
313 // Spdy might be turned on by default, or it might be over npn. | 314 // Spdy might be turned on by default, or it might be over npn. |
314 bool using_spdy = params_->force_spdy_over_ssl() || | 315 bool using_spdy = params_->force_spdy_over_ssl() || |
315 params_->want_spdy_over_npn(); | 316 params_->want_spdy_over_npn(); |
316 | 317 |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 | 585 |
585 ClientSocketPoolHistograms* SSLClientSocketPool::histograms() const { | 586 ClientSocketPoolHistograms* SSLClientSocketPool::histograms() const { |
586 return base_.histograms(); | 587 return base_.histograms(); |
587 } | 588 } |
588 | 589 |
589 void SSLClientSocketPool::OnSSLConfigChanged() { | 590 void SSLClientSocketPool::OnSSLConfigChanged() { |
590 Flush(); | 591 Flush(); |
591 } | 592 } |
592 | 593 |
593 } // namespace net | 594 } // namespace net |
OLD | NEW |