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

Unified Diff: net/quic/crypto/quic_crypto_client_config.cc

Issue 192583004: QUIC - use QuicSessionKey tuple (host, port, is_https) instead of server_hostname (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with TOT Created 6 years, 9 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
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 3b07586874778610ed5d3dd17a98beb8e859c4cd..0fa78a4b91613b55c38a9c58114c93ec5195a4a3 100644
--- a/net/quic/crypto/quic_crypto_client_config.cc
+++ b/net/quic/crypto/quic_crypto_client_config.cc
@@ -15,6 +15,7 @@
#include "net/quic/crypto/p256_key_exchange.h"
#include "net/quic/crypto/proof_verifier.h"
#include "net/quic/crypto/quic_encrypter.h"
+#include "net/quic/quic_session_key.h"
#include "net/quic/quic_utils.h"
#if defined(OS_WIN)
@@ -22,6 +23,7 @@
#endif
using base::StringPiece;
+using std::make_pair;
using std::map;
using std::string;
using std::vector;
@@ -253,15 +255,15 @@ void QuicCryptoClientConfig::SetDefaults() {
}
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;
}
CachedState* cached = new CachedState;
- cached_states_.insert(make_pair(server_hostname, cached));
+ cached_states_.insert(make_pair(server_key, cached));
return cached;
}
@@ -666,15 +668,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);
}

Powered by Google App Engine
This is Rietveld 408576698