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/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 enable_ping_based_connection_checking_( | 405 enable_ping_based_connection_checking_( |
406 enable_ping_based_connection_checking), | 406 enable_ping_based_connection_checking), |
407 protocol_(default_protocol), | 407 protocol_(default_protocol), |
408 credential_state_(SpdyCredentialState::kDefaultNumSlots), | 408 credential_state_(SpdyCredentialState::kDefaultNumSlots), |
409 connection_at_risk_of_loss_time_( | 409 connection_at_risk_of_loss_time_( |
410 base::TimeDelta::FromSeconds(kDefaultConnectionAtRiskOfLossSeconds)), | 410 base::TimeDelta::FromSeconds(kDefaultConnectionAtRiskOfLossSeconds)), |
411 hung_interval_( | 411 hung_interval_( |
412 base::TimeDelta::FromSeconds(kHungIntervalSeconds)), | 412 base::TimeDelta::FromSeconds(kHungIntervalSeconds)), |
413 trusted_spdy_proxy_(trusted_spdy_proxy), | 413 trusted_spdy_proxy_(trusted_spdy_proxy), |
414 time_func_(time_func) { | 414 time_func_(time_func) { |
415 // TODO(akalin): Change this to kProtoSPDYMinimumVersion once we | 415 DCHECK_GE(protocol_, kProtoSPDYMinimumVersion); |
416 // stop supporting SPDY/1. | |
417 DCHECK_GE(protocol_, kProtoSPDY2); | |
418 DCHECK_LE(protocol_, kProtoSPDYMaximumVersion); | 416 DCHECK_LE(protocol_, kProtoSPDYMaximumVersion); |
419 DCHECK(HttpStreamFactory::spdy_enabled()); | 417 DCHECK(HttpStreamFactory::spdy_enabled()); |
420 net_log_.BeginEvent( | 418 net_log_.BeginEvent( |
421 NetLog::TYPE_SPDY_SESSION, | 419 NetLog::TYPE_SPDY_SESSION, |
422 base::Bind(&NetLogSpdySessionCallback, &host_port_proxy_pair())); | 420 base::Bind(&NetLogSpdySessionCallback, &host_port_proxy_pair())); |
423 next_unclaimed_push_stream_sweep_time_ = time_func_() + | 421 next_unclaimed_push_stream_sweep_time_ = time_func_() + |
424 base::TimeDelta::FromSeconds(kMinPushedStreamLifetimeSeconds); | 422 base::TimeDelta::FromSeconds(kMinPushedStreamLifetimeSeconds); |
425 // TODO(mbelshe): consider randomization of the stream_hi_water_mark. | 423 // TODO(mbelshe): consider randomization of the stream_hi_water_mark. |
426 } | 424 } |
427 | 425 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 | 461 |
464 connection_ = connection.Pass(); | 462 connection_ = connection.Pass(); |
465 is_secure_ = is_secure; | 463 is_secure_ = is_secure; |
466 certificate_error_code_ = certificate_error_code; | 464 certificate_error_code_ = certificate_error_code; |
467 | 465 |
468 NextProto protocol_negotiated = | 466 NextProto protocol_negotiated = |
469 connection_->socket()->GetNegotiatedProtocol(); | 467 connection_->socket()->GetNegotiatedProtocol(); |
470 if (protocol_negotiated != kProtoUnknown) { | 468 if (protocol_negotiated != kProtoUnknown) { |
471 protocol_ = protocol_negotiated; | 469 protocol_ = protocol_negotiated; |
472 } | 470 } |
473 // TODO(akalin): Change this to kProtoSPDYMinimumVersion once we | 471 DCHECK_GE(protocol_, kProtoSPDYMinimumVersion); |
474 // stop supporting SPDY/1. | |
475 DCHECK_GE(protocol_, kProtoSPDY2); | |
476 DCHECK_LE(protocol_, kProtoSPDYMaximumVersion); | 472 DCHECK_LE(protocol_, kProtoSPDYMaximumVersion); |
477 | 473 |
478 SSLClientSocket* ssl_socket = GetSSLClientSocket(); | 474 SSLClientSocket* ssl_socket = GetSSLClientSocket(); |
479 if (ssl_socket && ssl_socket->WasChannelIDSent()) { | 475 if (ssl_socket && ssl_socket->WasChannelIDSent()) { |
480 // According to the SPDY spec, the credential associated with the TLS | 476 // According to the SPDY spec, the credential associated with the TLS |
481 // connection is stored in slot[1]. | 477 // connection is stored in slot[1]. |
482 credential_state_.SetHasCredential(GURL("https://" + | 478 credential_state_.SetHasCredential(GURL("https://" + |
483 host_port_pair().ToString())); | 479 host_port_pair().ToString())); |
484 } | 480 } |
485 | 481 |
(...skipping 2449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2935 if (!queue->empty()) { | 2931 if (!queue->empty()) { |
2936 SpdyStreamId stream_id = queue->front(); | 2932 SpdyStreamId stream_id = queue->front(); |
2937 queue->pop_front(); | 2933 queue->pop_front(); |
2938 return stream_id; | 2934 return stream_id; |
2939 } | 2935 } |
2940 } | 2936 } |
2941 return 0; | 2937 return 0; |
2942 } | 2938 } |
2943 | 2939 |
2944 } // namespace net | 2940 } // namespace net |
OLD | NEW |