| Index: net/spdy/chromium/spdy_session.cc
|
| diff --git a/net/spdy/chromium/spdy_session.cc b/net/spdy/chromium/spdy_session.cc
|
| index cdf864b2f5cbf02c9f3652bffeccabcd0ff646b0..8f2921cb7bc0e8b4d7cd6d937d10d6b76462dc6a 100644
|
| --- a/net/spdy/chromium/spdy_session.cc
|
| +++ b/net/spdy/chromium/spdy_session.cc
|
| @@ -729,6 +729,7 @@ bool SpdySession::CanPool(TransportSecurityState* transport_security_state,
|
| SpdySession::SpdySession(const SpdySessionKey& spdy_session_key,
|
| HttpServerProperties* http_server_properties,
|
| TransportSecurityState* transport_security_state,
|
| + const QuicVersionVector& quic_supported_versions,
|
| bool enable_sending_initial_data,
|
| bool enable_ping_based_connection_checking,
|
| size_t session_max_recv_window_size,
|
| @@ -780,6 +781,7 @@ SpdySession::SpdySession(const SpdySessionKey& spdy_session_key,
|
| initial_settings.at(SETTINGS_INITIAL_WINDOW_SIZE)),
|
| net_log_(
|
| NetLogWithSource::Make(net_log, NetLogSourceType::HTTP2_SESSION)),
|
| + quic_supported_versions_(quic_supported_versions),
|
| enable_sending_initial_data_(enable_sending_initial_data),
|
| enable_ping_based_connection_checking_(
|
| enable_ping_based_connection_checking),
|
| @@ -3012,10 +3014,35 @@ void SpdySession::OnAltSvc(
|
| AlternativeServiceInfoVector alternative_service_info_vector;
|
| alternative_service_info_vector.reserve(altsvc_vector.size());
|
| const base::Time now(base::Time::Now());
|
| + DCHECK(!quic_supported_versions_.empty());
|
| for (const SpdyAltSvcWireFormat::AlternativeService& altsvc : altsvc_vector) {
|
| const NextProto protocol = NextProtoFromString(altsvc.protocol_id);
|
| if (protocol == kProtoUnknown)
|
| continue;
|
| +
|
| + // TODO(zhongyi): refactor the QUIC version filtering to a single function
|
| + // so that SpdySession::OnAltSvc and
|
| + // HttpStreamFactory::ProcessAlternativeServices
|
| + // could use the the same function.
|
| + // Check if QUIC version is supported.
|
| + if (protocol == kProtoQUIC && !altsvc.version.empty()) {
|
| + bool match_found = false;
|
| + for (const QuicVersion& supported : quic_supported_versions_) {
|
| + for (const uint16_t& advertised : altsvc.version) {
|
| + if (supported == advertised) {
|
| + match_found = true;
|
| + break;
|
| + }
|
| + }
|
| + if (match_found) {
|
| + break;
|
| + }
|
| + }
|
| + if (!match_found) {
|
| + continue;
|
| + }
|
| + }
|
| +
|
| const AlternativeService alternative_service(protocol, altsvc.host,
|
| altsvc.port);
|
| const base::Time expiration =
|
|
|