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

Unified Diff: net/quic/quic_stream_factory.cc

Issue 13976007: Land Recent QUIC Changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated copyright notice Created 7 years, 8 months 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_utils.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 4bb64497ec8e78597c6830cb9bddd007921a0a15..fe25c509004c3d5d0aef9bdf10410477bdb6441f 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -198,8 +198,8 @@ scoped_ptr<QuicHttpStream> QuicStreamRequest::ReleaseStream() {
int QuicStreamFactory::Job::DoConnect() {
io_state_ = STATE_CONNECT_COMPLETE;
- session_ = factory_->CreateSession(host_port_proxy_pair_.first.host(),
- address_list_, net_log_);
+ session_ = factory_->CreateSession(host_port_proxy_pair_, address_list_,
+ net_log_);
session_->StartReading();
int rv = session_->CryptoConnect(
base::Bind(&QuicStreamFactory::Job::OnIOComplete,
@@ -360,7 +360,7 @@ bool QuicStreamFactory::HasActiveSession(
}
QuicClientSession* QuicStreamFactory::CreateSession(
- const std::string& host,
+ const HostPortProxyPair& host_port_proxy_pair,
const AddressList& address_list,
const BoundNetLog& net_log) {
QuicGuid guid = random_generator_->RandUint64();
@@ -377,10 +377,16 @@ QuicClientSession* QuicStreamFactory::CreateSession(
clock_.get(), random_generator_, socket);
QuicConnection* connection = new QuicConnection(guid, addr, helper, false);
+
+ QuicCryptoClientConfig* crypto_config =
+ GetOrCreateCryptoConfig(host_port_proxy_pair);
+ DCHECK(crypto_config);
+
QuicClientSession* session =
new QuicClientSession(connection, socket, this,
- quic_crypto_client_stream_factory_, host,
- net_log.net_log());
+ quic_crypto_client_stream_factory_,
+ host_port_proxy_pair.first.host(),
+ crypto_config, net_log.net_log());
all_sessions_.insert(session); // owning pointer
return session;
}
@@ -398,5 +404,18 @@ void QuicStreamFactory::ActivateSession(
session_aliases_[session].insert(host_port_proxy_pair);
}
+QuicCryptoClientConfig* QuicStreamFactory::GetOrCreateCryptoConfig(
+ const HostPortProxyPair& host_port_proxy_pair) {
+ QuicCryptoClientConfig* crypto_config;
+ if (ContainsKey(all_crypto_configs_, host_port_proxy_pair)) {
+ crypto_config = all_crypto_configs_[host_port_proxy_pair];
+ DCHECK(crypto_config);
+ } else {
+ crypto_config = new QuicCryptoClientConfig();
+ crypto_config->SetDefaults();
+ all_crypto_configs_[host_port_proxy_pair] = crypto_config;
+ }
+ return crypto_config;
+}
} // namespace net
« no previous file with comments | « net/quic/quic_stream_factory.h ('k') | net/quic/quic_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698