Chromium Code Reviews| Index: net/http/http_stream_factory.cc |
| diff --git a/net/http/http_stream_factory.cc b/net/http/http_stream_factory.cc |
| index 003933b71fa6bcb96ac6b42a0e2c0a5b81b82d7f..9364f8c0471c2ec6d6a43194939f8a992d69f0e0 100644 |
| --- a/net/http/http_stream_factory.cc |
| +++ b/net/http/http_stream_factory.cc |
| @@ -13,6 +13,7 @@ |
| #include "net/base/host_port_pair.h" |
| #include "net/base/port_util.h" |
| #include "net/http/http_network_session.h" |
| +#include "net/quic/quic_protocol.h" |
| #include "net/spdy/spdy_alt_svc_wire_format.h" |
| #include "url/gurl.h" |
| @@ -54,6 +55,23 @@ void HttpStreamFactory::ProcessAlternativeService( |
| !IsPortValid(alternative_service_entry.port)) { |
| continue; |
| } |
| + // Check if QUIC version is supported. |
| + if (protocol == QUIC && !alternative_service_entry.version.empty()) { |
| + SpdyAltSvcWireFormat::VersionVector::const_iterator begin = |
| + alternative_service_entry.version.begin(); |
| + SpdyAltSvcWireFormat::VersionVector::const_iterator end = |
| + alternative_service_entry.version.end(); |
| + bool match_found = false; |
| + for (QuicVersion supported : session.params().quic_supported_versions) { |
| + if (std::find(begin, end, static_cast<uint16>(supported)) != end) { |
| + match_found = true; |
|
Ryan Hamilton
2015/10/29 20:07:23
Up to you, but instead of using std::find, I wonde
|
| + break; |
| + } |
| + } |
| + if (!match_found) { |
| + continue; |
| + } |
| + } |
| AlternativeService alternative_service(protocol, |
| alternative_service_entry.host, |
| alternative_service_entry.port); |