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

Unified Diff: net/quic/quic_stream_factory.cc

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 cf706086d4507921c5d41435dcd96238ba02f234..076797af0a0bc5e687762d7a9b617e4ecb2b28ea 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -944,6 +944,14 @@ int QuicStreamFactory::CreateSession(
}
}
+ if (quic_server_info_factory_ && !server_info) {
+ // Start the disk cache loading so that we can persist the newer QUIC server
+ // information and/or inform the disk cache that we have reused
+ // |server_info|.
+ server_info.reset(quic_server_info_factory_->GetForServer(server_id));
+ server_info->Start();
+ }
+
*session = new QuicClientSession(
connection, socket.Pass(), this, transport_security_state_,
server_info.Pass(), config, server_id.is_https(),
@@ -985,6 +993,8 @@ void QuicStreamFactory::ActivateSession(
void QuicStreamFactory::InitializeCachedStateInCryptoConfig(
const QuicServerId& server_id,
const scoped_ptr<QuicServerInfo>& server_info) {
+ // |server_info| will be NULL, if a non-empty server config already exists in
+ // the memory cache. This is a minor optimization to avoid LookupOrCreate.
if (!server_info)
return;
@@ -993,6 +1003,27 @@ void QuicStreamFactory::InitializeCachedStateInCryptoConfig(
if (!cached->IsEmpty())
return;
+ if (http_server_properties_) {
+ if (quic_supported_servers_at_startup_.empty()) {
+ for (const std::pair<net::HostPortPair, net::AlternateProtocolInfo>&
+ key_value : http_server_properties_->alternate_protocol_map()) {
+ if (key_value.second.protocol == QUIC) {
+ quic_supported_servers_at_startup_.insert(key_value.first);
+ }
+ }
+ }
+
+ // TODO(rtenneti): Delete the following histogram after collecting stats.
+ // If the AlternateProtocolMap contained an entry for this host, check if
+ // the disk cache contained an entry for it.
+ if (ContainsKey(quic_supported_servers_at_startup_,
+ server_id.host_port_pair())) {
+ UMA_HISTOGRAM_BOOLEAN(
+ "Net.QuicServerInfo.ExpectConfigMissingFromDiskCache",
+ server_info->state().server_config.empty());
+ }
+ }
+
if (!cached->Initialize(server_info->state().server_config,
server_info->state().source_address_token,
server_info->state().certs,
« 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