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

Unified Diff: net/quic/quic_stream_factory.h

Issue 190063008: Include the scheme in the key for QUIC the session map. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | net/quic/quic_stream_factory.cc » ('j') | net/quic/quic_stream_factory_test.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_stream_factory.h
diff --git a/net/quic/quic_stream_factory.h b/net/quic/quic_stream_factory.h
index 3f970bd3809619dce373aa68565fbbeb587ed28d..d1f29182e8724e8f289770e207dcb9255377e76f 100644
--- a/net/quic/quic_stream_factory.h
+++ b/net/quic/quic_stream_factory.h
@@ -112,12 +112,6 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
const BoundNetLog& net_log,
QuicStreamRequest* request);
- // Returns a newly created QuicHttpStream owned by the caller, if a
- // matching session already exists. Returns NULL otherwise.
- scoped_ptr<QuicHttpStream> CreateIfSessionExists(
- const HostPortProxyPair& host_port_proxy_pair,
- const BoundNetLog& net_log);
-
// Called by a session when it becomes idle.
void OnIdleSession(QuicClientSession* session);
@@ -170,30 +164,62 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
class Job;
friend class test::QuicStreamFactoryPeer;
- typedef std::map<HostPortProxyPair, QuicClientSession*> SessionMap;
- typedef std::set<HostPortProxyPair> AliasSet;
+ struct SessionKey {
+ SessionKey();
+ SessionKey(HostPortProxyPair host_port_proxy_pair,
+ bool is_https);
+ ~SessionKey();
+
+ HostPortProxyPair host_port_proxy_pair;
+ bool is_https;
+
+ // Needed to be an element of std::set.
+ bool operator<(const SessionKey &other) const;
+ bool operator==(const SessionKey &other) const;
+ };
+
+ struct IpAliasKey {
+ IpAliasKey();
+ IpAliasKey(IPEndPoint ip_endpoint, bool is_https);
+ ~IpAliasKey();
+
+ IPEndPoint ip_endpoint;
+ bool is_https;
+
+ // Needed to be an element of std::set.
+ bool operator<(const IpAliasKey &other) const;
+ bool operator==(const IpAliasKey &other) const;
+ };
+
+ typedef std::map<SessionKey, QuicClientSession*> SessionMap;
+ typedef std::set<SessionKey> AliasSet;
typedef std::map<QuicClientSession*, AliasSet> SessionAliasMap;
typedef std::set<QuicClientSession*> SessionSet;
- typedef std::map<IPEndPoint, SessionSet> IPAliasMap;
+ typedef std::map<IpAliasKey, SessionSet> IPAliasMap;
typedef std::map<HostPortProxyPair, QuicCryptoClientConfig*> CryptoConfigMap;
typedef std::map<HostPortPair, HostPortProxyPair> CanonicalHostMap;
- typedef std::map<HostPortProxyPair, Job*> JobMap;
+ typedef std::map<SessionKey, Job*> JobMap;
typedef std::map<QuicStreamRequest*, Job*> RequestMap;
typedef std::set<QuicStreamRequest*> RequestSet;
typedef std::map<Job*, RequestSet> JobRequestsMap;
- bool OnResolution(const HostPortProxyPair& host_port_proxy_pair,
+ // Returns a newly created QuicHttpStream owned by the caller, if a
+ // matching session already exists. Returns NULL otherwise.
+ scoped_ptr<QuicHttpStream> CreateIfSessionExists(const SessionKey& key,
+ const BoundNetLog& net_log);
+
+ bool OnResolution(const SessionKey& session_key,
const AddressList& address_list);
void OnJobComplete(Job* job, int rv);
- bool HasActiveSession(const HostPortProxyPair& host_port_proxy_pair);
- bool HasActiveJob(const HostPortProxyPair& host_port_proxy_pair);
+ bool HasActiveSession(const SessionKey& session_key) const;
+ bool HasActiveJob(const SessionKey& session_key) const;
int CreateSession(const HostPortProxyPair& host_port_proxy_pair,
bool is_https,
CertVerifier* cert_verifier,
const AddressList& address_list,
const BoundNetLog& net_log,
QuicClientSession** session);
- void ActivateSession(const HostPortProxyPair& host_port_proxy_pair,
+ void ActivateSession(const SessionKey& key,
QuicClientSession* session);
QuicCryptoClientConfig* GetOrCreateCryptoConfig(
« no previous file with comments | « no previous file | net/quic/quic_stream_factory.cc » ('j') | net/quic/quic_stream_factory_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698