| Index: net/http/http_stream_factory_impl.cc
|
| diff --git a/net/http/http_stream_factory_impl.cc b/net/http/http_stream_factory_impl.cc
|
| index 12d14a2fd7b385018745b1eae01180ba6f49ed7b..526083e2ea39a61b56866e1840ee36f85ff1605d 100644
|
| --- a/net/http/http_stream_factory_impl.cc
|
| +++ b/net/http/http_stream_factory_impl.cc
|
| @@ -8,11 +8,13 @@
|
|
|
| #include "base/logging.h"
|
| #include "base/stl_util.h"
|
| +#include "base/strings/string_util.h"
|
| #include "net/base/net_util.h"
|
| #include "net/http/http_network_session.h"
|
| #include "net/http/http_server_properties.h"
|
| #include "net/http/http_stream_factory_impl_job.h"
|
| #include "net/http/http_stream_factory_impl_request.h"
|
| +#include "net/http/transport_security_state.h"
|
| #include "net/log/net_log.h"
|
| #include "net/quic/quic_server_id.h"
|
| #include "net/spdy/spdy_http_stream.h"
|
| @@ -285,6 +287,9 @@ AlternativeService HttpStreamFactoryImpl::GetAlternativeServiceFor(
|
| server_id, request_info.privacy_mode, origin_host))
|
| return alternative_service;
|
|
|
| + if (!IsQuicWhitelistedForHost(destination.host()))
|
| + continue;
|
| +
|
| // Cache this entry if we don't have a non-broken Alt-Svc yet.
|
| if (first_alternative_service.protocol == UNINITIALIZED_ALTERNATE_PROTOCOL)
|
| first_alternative_service = alternative_service;
|
| @@ -365,4 +370,16 @@ void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) {
|
| OnPreconnectsCompleteInternal();
|
| }
|
|
|
| +bool HttpStreamFactoryImpl::IsQuicWhitelistedForHost(const std::string& host) {
|
| + if (session_->params().transport_security_state->IsGooglePinnedHost(host))
|
| + return true;
|
| +
|
| + std::string lower_host = base::ToLowerASCII(host);
|
| + if (ContainsKey(session_->params().quic_host_whitelist, lower_host))
|
| + return true;
|
| +
|
| + return base::EndsWith(lower_host, ".snapchat.com",
|
| + base::CompareCase::SENSITIVE);
|
| +}
|
| +
|
| } // namespace net
|
|
|