Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Unified Diff: net/quic/quic_stream_factory.cc

Issue 811073004: QUIC - don't load data from disk cache if alternate protocol map doesn't (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed comments from Patch Set 2 Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_stream_factory.h ('k') | net/quic/quic_stream_factory_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_stream_factory.cc
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index 45c60c091f0498759d63493db93aff19ab95bd50..3253e906816ee135a98d1f7e1c3d1bf3ce9a718e 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -545,6 +545,7 @@ QuicStreamFactory::QuicStreamFactory(
bool always_require_handshake_confirmation,
bool disable_connection_pooling,
int load_server_info_timeout,
+ bool disable_loading_server_info_for_new_servers,
const QuicTagVector& connection_options)
: require_confirmation_(true),
host_resolver_(host_resolver),
@@ -563,6 +564,8 @@ QuicStreamFactory::QuicStreamFactory(
always_require_handshake_confirmation),
disable_connection_pooling_(disable_connection_pooling),
load_server_info_timeout_ms_(load_server_info_timeout),
+ disable_loading_server_info_for_new_servers_(
+ disable_loading_server_info_for_new_servers),
port_seed_(random_generator_->RandUint64()),
check_persisted_supports_quic_(true),
task_runner_(nullptr),
@@ -623,11 +626,25 @@ 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 (disable_loading_server_info_for_new_servers_) {
+ 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) {
+ // If there is no entry for QUIC, consider that as a new server and
+ // don't wait for Cache thread to load the data for that server.
+ 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
« no previous file with comments | « net/quic/quic_stream_factory.h ('k') | net/quic/quic_stream_factory_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698