| Index: net/quic/crypto/quic_crypto_client_config.cc
|
| diff --git a/net/quic/crypto/quic_crypto_client_config.cc b/net/quic/crypto/quic_crypto_client_config.cc
|
| index 5ee46b228bcc31d8237186c9a3c6eaafccadc306..bbbb3baed5f27cd9d3e126fa028c549219668d18 100644
|
| --- a/net/quic/crypto/quic_crypto_client_config.cc
|
| +++ b/net/quic/crypto/quic_crypto_client_config.cc
|
| @@ -16,6 +16,7 @@
|
| #include "net/quic/crypto/proof_verifier.h"
|
| #include "net/quic/crypto/quic_encrypter.h"
|
| #include "net/quic/crypto/quic_server_info.h"
|
| +#include "net/quic/quic_session_key.h"
|
| #include "net/quic/quic_utils.h"
|
|
|
| #if defined(OS_WIN)
|
| @@ -23,6 +24,7 @@
|
| #endif
|
|
|
| using base::StringPiece;
|
| +using std::make_pair;
|
| using std::map;
|
| using std::string;
|
| using std::vector;
|
| @@ -231,7 +233,7 @@ void QuicCryptoClientConfig::CachedState::InitializeFrom(
|
| }
|
|
|
| // An issue to be solved: while we are loading the data from disk cache, it is
|
| -// possible for another request for the same hostname update the CachedState
|
| +// possible for another request for the same |server_key| update the CachedState
|
| // because that request has sent FillInchoateClientHello and got REJ message.
|
| // Loading of data from disk cache shouldn't blindly overwrite what is in
|
| // CachedState.
|
| @@ -295,29 +297,29 @@ void QuicCryptoClientConfig::SetDefaults() {
|
| }
|
|
|
| QuicCryptoClientConfig::CachedState* QuicCryptoClientConfig::Create(
|
| - const string& server_hostname,
|
| + const QuicSessionKey& server_key,
|
| QuicServerInfoFactory* quic_server_info_factory) {
|
| - DCHECK(cached_states_.find(server_hostname) == cached_states_.end());
|
| + DCHECK(cached_states_.find(server_key) == cached_states_.end());
|
| scoped_ptr<QuicServerInfo> quic_server_info;
|
| if (quic_server_info_factory) {
|
| quic_server_info.reset(
|
| - quic_server_info_factory->GetForHost(server_hostname));
|
| + quic_server_info_factory->GetForServer(server_key));
|
| quic_server_info->Start();
|
| }
|
|
|
| CachedState* cached = new CachedState(quic_server_info.Pass());
|
| - cached_states_.insert(make_pair(server_hostname, cached));
|
| + cached_states_.insert(make_pair(server_key, cached));
|
| return cached;
|
| }
|
|
|
| QuicCryptoClientConfig::CachedState* QuicCryptoClientConfig::LookupOrCreate(
|
| - const string& server_hostname) {
|
| - map<string, CachedState*>::const_iterator it =
|
| - cached_states_.find(server_hostname);
|
| + const QuicSessionKey& server_key) {
|
| + map<QuicSessionKey, CachedState*>::const_iterator it =
|
| + cached_states_.find(server_key);
|
| if (it != cached_states_.end()) {
|
| return it->second;
|
| }
|
| - return Create(server_hostname, NULL);
|
| + return Create(server_key, NULL);
|
| }
|
|
|
| void QuicCryptoClientConfig::FillInchoateClientHello(
|
| @@ -721,15 +723,15 @@ void QuicCryptoClientConfig::SetChannelIDSigner(ChannelIDSigner* signer) {
|
| }
|
|
|
| void QuicCryptoClientConfig::InitializeFrom(
|
| - const std::string& server_hostname,
|
| - const std::string& canonical_server_hostname,
|
| + const QuicSessionKey& server_key,
|
| + const QuicSessionKey& canonical_server_key,
|
| QuicCryptoClientConfig* canonical_crypto_config) {
|
| CachedState* canonical_cached =
|
| - canonical_crypto_config->LookupOrCreate(canonical_server_hostname);
|
| + canonical_crypto_config->LookupOrCreate(canonical_server_key);
|
| if (!canonical_cached->proof_valid()) {
|
| return;
|
| }
|
| - CachedState* cached = LookupOrCreate(server_hostname);
|
| + CachedState* cached = LookupOrCreate(server_key);
|
| cached->InitializeFrom(*canonical_cached);
|
| }
|
|
|
|
|