| Index: net/quic/quic_stream_factory.cc
|
| diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
|
| index ecd338aaa80e8f9993776d42bfd2efb1ef99698b..a0d93743e3a79b4f60931e7ca97c31d7a3c34f5c 100644
|
| --- a/net/quic/quic_stream_factory.cc
|
| +++ b/net/quic/quic_stream_factory.cc
|
| @@ -510,6 +510,7 @@ QuicStreamFactory::QuicStreamFactory(
|
| bool always_require_handshake_confirmation,
|
| bool disable_connection_pooling,
|
| int load_server_info_timeout,
|
| + bool load_server_info_if_already_spoke_quic,
|
| const QuicTagVector& connection_options)
|
| : require_confirmation_(true),
|
| host_resolver_(host_resolver),
|
| @@ -528,6 +529,8 @@ QuicStreamFactory::QuicStreamFactory(
|
| always_require_handshake_confirmation),
|
| disable_connection_pooling_(disable_connection_pooling),
|
| load_server_info_timeout_ms_(load_server_info_timeout),
|
| + load_server_info_if_already_spoke_quic_(
|
| + load_server_info_if_already_spoke_quic),
|
| port_seed_(random_generator_->RandUint64()),
|
| check_persisted_supports_quic_(true),
|
| task_runner_(nullptr),
|
| @@ -588,11 +591,22 @@ int QuicStreamFactory::Create(const HostPortPair& host_port_pair,
|
|
|
| QuicServerInfo* quic_server_info = nullptr;
|
| if (quic_server_info_factory_) {
|
| - QuicCryptoClientConfig::CachedState* cached =
|
| - crypto_config_.LookupOrCreate(server_id);
|
| - DCHECK(cached);
|
| - if (cached->IsEmpty()) {
|
| - quic_server_info = quic_server_info_factory_->GetForServer(server_id);
|
| + bool load_from_disk_cache = true;
|
| + if (load_server_info_if_already_spoke_quic_) {
|
| + const AlternateProtocolMap& alternate_protocol_map =
|
| + http_server_properties_->alternate_protocol_map();
|
| + AlternateProtocolMap::const_iterator it =
|
| + alternate_protocol_map.Peek(server_id.host_port_pair());
|
| + if (it == alternate_protocol_map.end() || it->second.protocol != QUIC)
|
| + load_from_disk_cache = false;
|
| + }
|
| + if (load_from_disk_cache) {
|
| + QuicCryptoClientConfig::CachedState* cached =
|
| + crypto_config_.LookupOrCreate(server_id);
|
| + DCHECK(cached);
|
| + if (cached->IsEmpty()) {
|
| + quic_server_info = quic_server_info_factory_->GetForServer(server_id);
|
| + }
|
| }
|
| }
|
| // TODO(rtenneti): Initialize task_runner_ in the constructor after
|
|
|