| 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(
|
|
|