| 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 NextProto protocol_negotiated = | 298 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 == kProtoSPDY1 || | 304 if (protocol_negotiated == kProtoSPDY1 || |
| 305 protocol_negotiated == kProtoSPDY2 || | 305 protocol_negotiated == kProtoSPDY2 || |
| 306 protocol_negotiated == kProtoSPDY21 || | |
| 307 protocol_negotiated == kProtoSPDY3) { | 306 protocol_negotiated == kProtoSPDY3) { |
| 308 ssl_socket_->set_was_spdy_negotiated(true); | 307 ssl_socket_->set_was_spdy_negotiated(true); |
| 309 } | 308 } |
| 310 } | 309 } |
| 311 if (params_->want_spdy_over_npn() && !ssl_socket_->was_spdy_negotiated()) | 310 if (params_->want_spdy_over_npn() && !ssl_socket_->was_spdy_negotiated()) |
| 312 return ERR_NPN_NEGOTIATION_FAILED; | 311 return ERR_NPN_NEGOTIATION_FAILED; |
| 313 | 312 |
| 314 // Spdy might be turned on by default, or it might be over npn. | 313 // Spdy might be turned on by default, or it might be over npn. |
| 315 bool using_spdy = params_->force_spdy_over_ssl() || | 314 bool using_spdy = params_->force_spdy_over_ssl() || |
| 316 params_->want_spdy_over_npn(); | 315 params_->want_spdy_over_npn(); |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 Flush(); | 617 Flush(); |
| 619 } | 618 } |
| 620 | 619 |
| 621 bool SSLClientSocketPool::CloseOneIdleConnection() { | 620 bool SSLClientSocketPool::CloseOneIdleConnection() { |
| 622 if (base_.CloseOneIdleSocket()) | 621 if (base_.CloseOneIdleSocket()) |
| 623 return true; | 622 return true; |
| 624 return base_.CloseOneIdleConnectionInLayeredPool(); | 623 return base_.CloseOneIdleConnectionInLayeredPool(); |
| 625 } | 624 } |
| 626 | 625 |
| 627 } // namespace net | 626 } // namespace net |
| OLD | NEW |