| 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 <limits> | 8 #include <limits> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 new_hostname, ssl_info.cert.get(), ssl_info.public_key_hashes)) { | 616 new_hostname, ssl_info.cert.get(), ssl_info.public_key_hashes)) { |
| 617 return false; | 617 return false; |
| 618 } | 618 } |
| 619 | 619 |
| 620 return true; | 620 return true; |
| 621 } | 621 } |
| 622 | 622 |
| 623 SpdySession::SpdySession(const SpdySessionKey& spdy_session_key, | 623 SpdySession::SpdySession(const SpdySessionKey& spdy_session_key, |
| 624 HttpServerProperties* http_server_properties, | 624 HttpServerProperties* http_server_properties, |
| 625 TransportSecurityState* transport_security_state, | 625 TransportSecurityState* transport_security_state, |
| 626 bool verify_domain_authentication, | |
| 627 bool enable_sending_initial_data, | 626 bool enable_sending_initial_data, |
| 628 bool enable_ping_based_connection_checking, | 627 bool enable_ping_based_connection_checking, |
| 629 size_t session_max_recv_window_size, | 628 size_t session_max_recv_window_size, |
| 630 size_t stream_max_recv_window_size, | 629 size_t stream_max_recv_window_size, |
| 631 TimeFunc time_func, | 630 TimeFunc time_func, |
| 632 ProxyDelegate* proxy_delegate, | 631 ProxyDelegate* proxy_delegate, |
| 633 NetLog* net_log) | 632 NetLog* net_log) |
| 634 : in_io_loop_(false), | 633 : in_io_loop_(false), |
| 635 spdy_session_key_(spdy_session_key), | 634 spdy_session_key_(spdy_session_key), |
| 636 pool_(NULL), | 635 pool_(NULL), |
| (...skipping 29 matching lines...) Expand all Loading... |
| 666 last_compressed_frame_len_(0), | 665 last_compressed_frame_len_(0), |
| 667 check_ping_status_pending_(false), | 666 check_ping_status_pending_(false), |
| 668 session_send_window_size_(0), | 667 session_send_window_size_(0), |
| 669 session_max_recv_window_size_(session_max_recv_window_size), | 668 session_max_recv_window_size_(session_max_recv_window_size), |
| 670 session_recv_window_size_(0), | 669 session_recv_window_size_(0), |
| 671 session_unacked_recv_window_bytes_(0), | 670 session_unacked_recv_window_bytes_(0), |
| 672 stream_initial_send_window_size_(kDefaultInitialWindowSize), | 671 stream_initial_send_window_size_(kDefaultInitialWindowSize), |
| 673 stream_max_recv_window_size_(stream_max_recv_window_size), | 672 stream_max_recv_window_size_(stream_max_recv_window_size), |
| 674 net_log_( | 673 net_log_( |
| 675 NetLogWithSource::Make(net_log, NetLogSourceType::HTTP2_SESSION)), | 674 NetLogWithSource::Make(net_log, NetLogSourceType::HTTP2_SESSION)), |
| 676 verify_domain_authentication_(verify_domain_authentication), | |
| 677 enable_sending_initial_data_(enable_sending_initial_data), | 675 enable_sending_initial_data_(enable_sending_initial_data), |
| 678 enable_ping_based_connection_checking_( | 676 enable_ping_based_connection_checking_( |
| 679 enable_ping_based_connection_checking), | 677 enable_ping_based_connection_checking), |
| 680 connection_at_risk_of_loss_time_( | 678 connection_at_risk_of_loss_time_( |
| 681 base::TimeDelta::FromSeconds(kDefaultConnectionAtRiskOfLossSeconds)), | 679 base::TimeDelta::FromSeconds(kDefaultConnectionAtRiskOfLossSeconds)), |
| 682 hung_interval_(base::TimeDelta::FromSeconds(kHungIntervalSeconds)), | 680 hung_interval_(base::TimeDelta::FromSeconds(kHungIntervalSeconds)), |
| 683 proxy_delegate_(proxy_delegate), | 681 proxy_delegate_(proxy_delegate), |
| 684 time_func_(time_func), | 682 time_func_(time_func), |
| 685 weak_factory_(this) { | 683 weak_factory_(this) { |
| 686 net_log_.BeginEvent( | 684 net_log_.BeginEvent( |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 pool_ = pool; | 744 pool_ = pool; |
| 747 | 745 |
| 748 // Bootstrap the read loop. | 746 // Bootstrap the read loop. |
| 749 base::ThreadTaskRunnerHandle::Get()->PostTask( | 747 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 750 FROM_HERE, | 748 FROM_HERE, |
| 751 base::Bind(&SpdySession::PumpReadLoop, weak_factory_.GetWeakPtr(), | 749 base::Bind(&SpdySession::PumpReadLoop, weak_factory_.GetWeakPtr(), |
| 752 READ_STATE_DO_READ, OK)); | 750 READ_STATE_DO_READ, OK)); |
| 753 } | 751 } |
| 754 | 752 |
| 755 bool SpdySession::VerifyDomainAuthentication(const std::string& domain) { | 753 bool SpdySession::VerifyDomainAuthentication(const std::string& domain) { |
| 756 if (!verify_domain_authentication_) | |
| 757 return true; | |
| 758 | |
| 759 if (availability_state_ == STATE_DRAINING) | 754 if (availability_state_ == STATE_DRAINING) |
| 760 return false; | 755 return false; |
| 761 | 756 |
| 762 SSLInfo ssl_info; | 757 SSLInfo ssl_info; |
| 763 if (!GetSSLInfo(&ssl_info)) | 758 if (!GetSSLInfo(&ssl_info)) |
| 764 return true; // This is not a secure session, so all domains are okay. | 759 return true; // This is not a secure session, so all domains are okay. |
| 765 | 760 |
| 766 return CanPool(transport_security_state_, ssl_info, | 761 return CanPool(transport_security_state_, ssl_info, |
| 767 host_port_pair().host(), domain); | 762 host_port_pair().host(), domain); |
| 768 } | 763 } |
| (...skipping 2371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3140 if (!queue->empty()) { | 3135 if (!queue->empty()) { |
| 3141 SpdyStreamId stream_id = queue->front(); | 3136 SpdyStreamId stream_id = queue->front(); |
| 3142 queue->pop_front(); | 3137 queue->pop_front(); |
| 3143 return stream_id; | 3138 return stream_id; |
| 3144 } | 3139 } |
| 3145 } | 3140 } |
| 3146 return 0; | 3141 return 0; |
| 3147 } | 3142 } |
| 3148 | 3143 |
| 3149 } // namespace net | 3144 } // namespace net |
| OLD | NEW |