[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef NET_QUIC_QUIC_STREAM_FACTORY_H_ |
| 6 | #define NET_QUIC_QUIC_STREAM_FACTORY_H_ |
| 7 | |
[email protected] | 1cd2a5f | 2014-03-14 06:33:25 | [diff] [blame] | 8 | #include <list> |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 9 | #include <map> |
[email protected] | 41d6b17 | 2013-01-29 16:10:57 | [diff] [blame] | 10 | #include <string> |
[email protected] | 6e12d70 | 2013-11-13 00:17:17 | [diff] [blame] | 11 | #include <vector> |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 12 | |
[email protected] | e8cf7555b | 2014-02-28 23:52:53 | [diff] [blame] | 13 | #include "base/logging.h" |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 14 | #include "base/memory/weak_ptr.h" |
| 15 | #include "net/base/address_list.h" |
| 16 | #include "net/base/completion_callback.h" |
| 17 | #include "net/base/host_port_pair.h" |
| 18 | #include "net/base/net_log.h" |
[email protected] | f698a01 | 2013-05-06 20:18:59 | [diff] [blame] | 19 | #include "net/base/network_change_notifier.h" |
[email protected] | d7d1e50b | 2013-11-25 22:08:09 | [diff] [blame] | 20 | #include "net/cert/cert_database.h" |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 21 | #include "net/proxy/proxy_server.h" |
[email protected] | ef95114d | 2013-04-17 17:57:01 | [diff] [blame] | 22 | #include "net/quic/quic_config.h" |
| 23 | #include "net/quic/quic_crypto_stream.h" |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 24 | #include "net/quic/quic_http_stream.h" |
| 25 | #include "net/quic/quic_protocol.h" |
| 26 | |
| 27 | namespace net { |
| 28 | |
[email protected] | 6d1b4ed | 2013-07-10 03:57:54 | [diff] [blame] | 29 | class CertVerifier; |
[email protected] | 6b8a3c74 | 2014-07-25 00:25:35 | [diff] [blame] | 30 | class ChannelIDService; |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 31 | class ClientSocketFactory; |
[email protected] | 6d1b4ed | 2013-07-10 03:57:54 | [diff] [blame] | 32 | class HostResolver; |
[email protected] | 77c6c16 | 2013-08-17 02:57:45 | [diff] [blame] | 33 | class HttpServerProperties; |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 34 | class QuicClock; |
| 35 | class QuicClientSession; |
[email protected] | 2cfc6bb8 | 2013-10-27 03:40:44 | [diff] [blame] | 36 | class QuicConnectionHelper; |
[email protected] | e8ff2684 | 2013-03-22 21:02:05 | [diff] [blame] | 37 | class QuicCryptoClientStreamFactory; |
[email protected] | 9558c5d3 | 2012-12-22 00:08:14 | [diff] [blame] | 38 | class QuicRandom; |
[email protected] | 7832eeb | 2014-01-25 10:10:43 | [diff] [blame] | 39 | class QuicServerInfoFactory; |
[email protected] | 257f24f | 2014-04-01 09:15:37 | [diff] [blame] | 40 | class QuicServerId; |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 41 | class QuicStreamFactory; |
[email protected] | 080b7793 | 2014-08-04 01:22:46 | [diff] [blame] | 42 | class TransportSecurityState; |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 43 | |
[email protected] | c49ff18 | 2013-09-28 08:33:26 | [diff] [blame] | 44 | namespace test { |
| 45 | class QuicStreamFactoryPeer; |
| 46 | } // namespace test |
| 47 | |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 48 | // Encapsulates a pending request for a QuicHttpStream. |
| 49 | // If the request is still pending when it is destroyed, it will |
| 50 | // cancel the request with the factory. |
| 51 | class NET_EXPORT_PRIVATE QuicStreamRequest { |
| 52 | public: |
| 53 | explicit QuicStreamRequest(QuicStreamFactory* factory); |
| 54 | ~QuicStreamRequest(); |
| 55 | |
[email protected] | 0cceb92 | 2014-07-01 02:00:56 | [diff] [blame] | 56 | // For http, |is_https| is false. |
[email protected] | bf4ea2f | 2014-03-10 22:57:53 | [diff] [blame] | 57 | int Request(const HostPortPair& host_port_pair, |
[email protected] | 6d1b4ed | 2013-07-10 03:57:54 | [diff] [blame] | 58 | bool is_https, |
[email protected] | 9dd3ff0f | 2014-03-26 09:51:28 | [diff] [blame] | 59 | PrivacyMode privacy_mode, |
[email protected] | 974849d | 2014-02-06 01:32:59 | [diff] [blame] | 60 | base::StringPiece method, |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 61 | const BoundNetLog& net_log, |
| 62 | const CompletionCallback& callback); |
| 63 | |
| 64 | void OnRequestComplete(int rv); |
| 65 | |
| 66 | scoped_ptr<QuicHttpStream> ReleaseStream(); |
| 67 | |
| 68 | void set_stream(scoped_ptr<QuicHttpStream> stream); |
| 69 | |
| 70 | const BoundNetLog& net_log() const{ |
| 71 | return net_log_; |
| 72 | } |
| 73 | |
| 74 | private: |
| 75 | QuicStreamFactory* factory_; |
[email protected] | bf4ea2f | 2014-03-10 22:57:53 | [diff] [blame] | 76 | HostPortPair host_port_pair_; |
[email protected] | 6d1b4ed | 2013-07-10 03:57:54 | [diff] [blame] | 77 | bool is_https_; |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 78 | BoundNetLog net_log_; |
| 79 | CompletionCallback callback_; |
| 80 | scoped_ptr<QuicHttpStream> stream_; |
| 81 | |
| 82 | DISALLOW_COPY_AND_ASSIGN(QuicStreamRequest); |
| 83 | }; |
| 84 | |
| 85 | // A factory for creating new QuicHttpStreams on top of a pool of |
| 86 | // QuicClientSessions. |
[email protected] | f698a01 | 2013-05-06 20:18:59 | [diff] [blame] | 87 | class NET_EXPORT_PRIVATE QuicStreamFactory |
[email protected] | d7d1e50b | 2013-11-25 22:08:09 | [diff] [blame] | 88 | : public NetworkChangeNotifier::IPAddressObserver, |
| 89 | public CertDatabase::Observer { |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 90 | public: |
[email protected] | e8ff2684 | 2013-03-22 21:02:05 | [diff] [blame] | 91 | QuicStreamFactory( |
| 92 | HostResolver* host_resolver, |
| 93 | ClientSocketFactory* client_socket_factory, |
[email protected] | 77c6c16 | 2013-08-17 02:57:45 | [diff] [blame] | 94 | base::WeakPtr<HttpServerProperties> http_server_properties, |
[email protected] | 59c0bbd | 2014-03-22 04:08:12 | [diff] [blame] | 95 | CertVerifier* cert_verifier, |
[email protected] | 6b8a3c74 | 2014-07-25 00:25:35 | [diff] [blame] | 96 | ChannelIDService* channel_id_service, |
[email protected] | 080b7793 | 2014-08-04 01:22:46 | [diff] [blame] | 97 | TransportSecurityState* transport_security_state, |
[email protected] | e8ff2684 | 2013-03-22 21:02:05 | [diff] [blame] | 98 | QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory, |
| 99 | QuicRandom* random_generator, |
[email protected] | 256fe9b | 2013-11-27 01:58:02 | [diff] [blame] | 100 | QuicClock* clock, |
[email protected] | 1e96003 | 2013-12-20 19:00:20 | [diff] [blame] | 101 | size_t max_packet_length, |
[email protected] | 0c4017ca | 2014-06-06 03:30:45 | [diff] [blame] | 102 | const std::string& user_agent_id, |
[email protected] | 376d38a | 2014-01-22 03:47:35 | [diff] [blame] | 103 | const QuicVersionVector& supported_versions, |
[email protected] | c80f7c9 | 2014-02-27 13:12:02 | [diff] [blame] | 104 | bool enable_port_selection, |
jri | 2b966f2 | 2014-09-02 22:25:36 | [diff] [blame] | 105 | bool always_require_handshake_confirmation, |
jri | 584002d1 | 2014-09-09 00:51:28 | [diff] [blame] | 106 | bool disable_connection_pooling, |
[email protected] | 4b4efab3 | 2014-07-01 02:36:16 | [diff] [blame] | 107 | const QuicTagVector& connection_options); |
dcheng | b03027d | 2014-10-21 12:00:20 | [diff] [blame^] | 108 | ~QuicStreamFactory() override; |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 109 | |
[email protected] | bf4ea2f | 2014-03-10 22:57:53 | [diff] [blame] | 110 | // Creates a new QuicHttpStream to |host_port_pair| which will be |
[email protected] | 6d1b4ed | 2013-07-10 03:57:54 | [diff] [blame] | 111 | // owned by |request|. |is_https| specifies if the protocol is https or not. |
[email protected] | 0cceb92 | 2014-07-01 02:00:56 | [diff] [blame] | 112 | // If a matching session already exists, this method will return OK. If no |
| 113 | // matching session exists, this will return ERR_IO_PENDING and will invoke |
| 114 | // OnRequestComplete asynchronously. |
[email protected] | bf4ea2f | 2014-03-10 22:57:53 | [diff] [blame] | 115 | int Create(const HostPortPair& host_port_pair, |
[email protected] | 6d1b4ed | 2013-07-10 03:57:54 | [diff] [blame] | 116 | bool is_https, |
[email protected] | 9dd3ff0f | 2014-03-26 09:51:28 | [diff] [blame] | 117 | PrivacyMode privacy_mode, |
[email protected] | 974849d | 2014-02-06 01:32:59 | [diff] [blame] | 118 | base::StringPiece method, |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 119 | const BoundNetLog& net_log, |
| 120 | QuicStreamRequest* request); |
| 121 | |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 122 | // Called by a session when it becomes idle. |
| 123 | void OnIdleSession(QuicClientSession* session); |
| 124 | |
[email protected] | 4d283b3 | 2013-10-17 12:57:27 | [diff] [blame] | 125 | // Called by a session when it is going away and no more streams should be |
| 126 | // created on it. |
| 127 | void OnSessionGoingAway(QuicClientSession* session); |
| 128 | |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 129 | // Called by a session after it shuts down. |
[email protected] | 4d283b3 | 2013-10-17 12:57:27 | [diff] [blame] | 130 | void OnSessionClosed(QuicClientSession* session); |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 131 | |
[email protected] | 6576844 | 2014-06-06 23:37:03 | [diff] [blame] | 132 | // Called by a session whose connection has timed out. |
| 133 | void OnSessionConnectTimeout(QuicClientSession* session); |
| 134 | |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 135 | // Cancels a pending request. |
| 136 | void CancelRequest(QuicStreamRequest* request); |
| 137 | |
[email protected] | 56dfb90 | 2013-01-03 23:17:55 | [diff] [blame] | 138 | // Closes all current sessions. |
| 139 | void CloseAllSessions(int error); |
| 140 | |
[email protected] | c5b061b | 2013-01-05 00:31:34 | [diff] [blame] | 141 | base::Value* QuicStreamFactoryInfoToValue() const; |
| 142 | |
[email protected] | f7e21a43 | 2014-04-21 22:17:57 | [diff] [blame] | 143 | // Delete all cached state objects in |crypto_config_|. |
[email protected] | 60cf50e | 2014-04-28 23:23:18 | [diff] [blame] | 144 | void ClearCachedStatesInCryptoConfig(); |
[email protected] | f7e21a43 | 2014-04-21 22:17:57 | [diff] [blame] | 145 | |
[email protected] | f698a01 | 2013-05-06 20:18:59 | [diff] [blame] | 146 | // NetworkChangeNotifier::IPAddressObserver methods: |
| 147 | |
| 148 | // Until the servers support roaming, close all connections when the local |
| 149 | // IP address changes. |
dcheng | b03027d | 2014-10-21 12:00:20 | [diff] [blame^] | 150 | void OnIPAddressChanged() override; |
[email protected] | f698a01 | 2013-05-06 20:18:59 | [diff] [blame] | 151 | |
[email protected] | d7d1e50b | 2013-11-25 22:08:09 | [diff] [blame] | 152 | // CertDatabase::Observer methods: |
| 153 | |
| 154 | // We close all sessions when certificate database is changed. |
dcheng | b03027d | 2014-10-21 12:00:20 | [diff] [blame^] | 155 | void OnCertAdded(const X509Certificate* cert) override; |
| 156 | void OnCACertChanged(const X509Certificate* cert) override; |
[email protected] | d7d1e50b | 2013-11-25 22:08:09 | [diff] [blame] | 157 | |
jri | 2b966f2 | 2014-09-02 22:25:36 | [diff] [blame] | 158 | bool require_confirmation() const { |
| 159 | return require_confirmation_; |
| 160 | } |
[email protected] | 11c0587 | 2013-08-20 02:04:12 | [diff] [blame] | 161 | |
rtenneti | fc47e0e | 2014-09-26 02:54:05 | [diff] [blame] | 162 | void set_require_confirmation(bool require_confirmation); |
[email protected] | 11c0587 | 2013-08-20 02:04:12 | [diff] [blame] | 163 | |
[email protected] | 2cfc6bb8 | 2013-10-27 03:40:44 | [diff] [blame] | 164 | QuicConnectionHelper* helper() { return helper_.get(); } |
| 165 | |
[email protected] | 376d38a | 2014-01-22 03:47:35 | [diff] [blame] | 166 | bool enable_port_selection() const { return enable_port_selection_; } |
| 167 | |
[email protected] | a420520 | 2014-06-02 16:03:08 | [diff] [blame] | 168 | bool has_quic_server_info_factory() { |
| 169 | return quic_server_info_factory_ != NULL; |
| 170 | } |
| 171 | |
[email protected] | e8cf7555b | 2014-02-28 23:52:53 | [diff] [blame] | 172 | void set_quic_server_info_factory( |
| 173 | QuicServerInfoFactory* quic_server_info_factory) { |
| 174 | DCHECK(!quic_server_info_factory_); |
| 175 | quic_server_info_factory_ = quic_server_info_factory; |
| 176 | } |
| 177 | |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 178 | private: |
| 179 | class Job; |
[email protected] | c49ff18 | 2013-09-28 08:33:26 | [diff] [blame] | 180 | friend class test::QuicStreamFactoryPeer; |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 181 | |
[email protected] | 9dd3ff0f | 2014-03-26 09:51:28 | [diff] [blame] | 182 | // The key used to find session by ip. Includes |
[email protected] | df157d9d | 2014-03-10 07:27:27 | [diff] [blame] | 183 | // the ip address, port, and scheme. |
| 184 | struct NET_EXPORT_PRIVATE IpAliasKey { |
| 185 | IpAliasKey(); |
| 186 | IpAliasKey(IPEndPoint ip_endpoint, bool is_https); |
| 187 | ~IpAliasKey(); |
| 188 | |
| 189 | IPEndPoint ip_endpoint; |
| 190 | bool is_https; |
| 191 | |
| 192 | // Needed to be an element of std::set. |
| 193 | bool operator<(const IpAliasKey &other) const; |
| 194 | bool operator==(const IpAliasKey &other) const; |
| 195 | }; |
| 196 | |
[email protected] | 257f24f | 2014-04-01 09:15:37 | [diff] [blame] | 197 | typedef std::map<QuicServerId, QuicClientSession*> SessionMap; |
[email protected] | 4d590c9c | 2014-05-02 05:14:33 | [diff] [blame] | 198 | typedef std::map<QuicClientSession*, QuicServerId> SessionIdMap; |
[email protected] | 257f24f | 2014-04-01 09:15:37 | [diff] [blame] | 199 | typedef std::set<QuicServerId> AliasSet; |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 200 | typedef std::map<QuicClientSession*, AliasSet> SessionAliasMap; |
| 201 | typedef std::set<QuicClientSession*> SessionSet; |
[email protected] | df157d9d | 2014-03-10 07:27:27 | [diff] [blame] | 202 | typedef std::map<IpAliasKey, SessionSet> IPAliasMap; |
[email protected] | 257f24f | 2014-04-01 09:15:37 | [diff] [blame] | 203 | typedef std::map<QuicServerId, QuicCryptoClientConfig*> CryptoConfigMap; |
| 204 | typedef std::map<QuicServerId, Job*> JobMap; |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 205 | typedef std::map<QuicStreamRequest*, Job*> RequestMap; |
| 206 | typedef std::set<QuicStreamRequest*> RequestSet; |
| 207 | typedef std::map<Job*, RequestSet> JobRequestsMap; |
| 208 | |
[email protected] | df157d9d | 2014-03-10 07:27:27 | [diff] [blame] | 209 | // Returns a newly created QuicHttpStream owned by the caller, if a |
| 210 | // matching session already exists. Returns NULL otherwise. |
[email protected] | 257f24f | 2014-04-01 09:15:37 | [diff] [blame] | 211 | scoped_ptr<QuicHttpStream> CreateIfSessionExists(const QuicServerId& key, |
[email protected] | df157d9d | 2014-03-10 07:27:27 | [diff] [blame] | 212 | const BoundNetLog& net_log); |
| 213 | |
[email protected] | 257f24f | 2014-04-01 09:15:37 | [diff] [blame] | 214 | bool OnResolution(const QuicServerId& server_id, |
[email protected] | eed749f9 | 2013-12-23 18:57:38 | [diff] [blame] | 215 | const AddressList& address_list); |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 216 | void OnJobComplete(Job* job, int rv); |
[email protected] | 257f24f | 2014-04-01 09:15:37 | [diff] [blame] | 217 | bool HasActiveSession(const QuicServerId& server_id) const; |
| 218 | bool HasActiveJob(const QuicServerId& server_id) const; |
| 219 | int CreateSession(const QuicServerId& server_id, |
[email protected] | 17bf15c | 2014-03-14 10:08:04 | [diff] [blame] | 220 | scoped_ptr<QuicServerInfo> quic_server_info, |
[email protected] | 338e798 | 2013-12-13 11:15:32 | [diff] [blame] | 221 | const AddressList& address_list, |
| 222 | const BoundNetLog& net_log, |
| 223 | QuicClientSession** session); |
[email protected] | 257f24f | 2014-04-01 09:15:37 | [diff] [blame] | 224 | void ActivateSession(const QuicServerId& key, |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 225 | QuicClientSession* session); |
| 226 | |
[email protected] | 257f24f | 2014-04-01 09:15:37 | [diff] [blame] | 227 | // Initializes the cached state associated with |server_id| in |
[email protected] | 59c0bbd | 2014-03-22 04:08:12 | [diff] [blame] | 228 | // |crypto_config_| with the information in |server_info|. |
[email protected] | 60cf50e | 2014-04-28 23:23:18 | [diff] [blame] | 229 | void InitializeCachedStateInCryptoConfig( |
| 230 | const QuicServerId& server_id, |
| 231 | const scoped_ptr<QuicServerInfo>& server_info); |
[email protected] | b694e48c | 2014-03-18 17:10:13 | [diff] [blame] | 232 | |
[email protected] | 4d590c9c | 2014-05-02 05:14:33 | [diff] [blame] | 233 | void ProcessGoingAwaySession(QuicClientSession* session, |
[email protected] | eb71ab6 | 2014-05-23 07:57:53 | [diff] [blame] | 234 | const QuicServerId& server_id, |
| 235 | bool was_session_active); |
[email protected] | 4d590c9c | 2014-05-02 05:14:33 | [diff] [blame] | 236 | |
[email protected] | 11c0587 | 2013-08-20 02:04:12 | [diff] [blame] | 237 | bool require_confirmation_; |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 238 | HostResolver* host_resolver_; |
| 239 | ClientSocketFactory* client_socket_factory_; |
[email protected] | 77c6c16 | 2013-08-17 02:57:45 | [diff] [blame] | 240 | base::WeakPtr<HttpServerProperties> http_server_properties_; |
[email protected] | 5db45220 | 2014-08-19 05:22:15 | [diff] [blame] | 241 | TransportSecurityState* transport_security_state_; |
[email protected] | 7832eeb | 2014-01-25 10:10:43 | [diff] [blame] | 242 | QuicServerInfoFactory* quic_server_info_factory_; |
[email protected] | e8ff2684 | 2013-03-22 21:02:05 | [diff] [blame] | 243 | QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory_; |
[email protected] | 9558c5d3 | 2012-12-22 00:08:14 | [diff] [blame] | 244 | QuicRandom* random_generator_; |
[email protected] | f1e97e9 | 2012-12-16 04:53:25 | [diff] [blame] | 245 | scoped_ptr<QuicClock> clock_; |
[email protected] | 256fe9b | 2013-11-27 01:58:02 | [diff] [blame] | 246 | const size_t max_packet_length_; |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 247 | |
[email protected] | 2cfc6bb8 | 2013-10-27 03:40:44 | [diff] [blame] | 248 | // The helper used for all connections. |
| 249 | scoped_ptr<QuicConnectionHelper> helper_; |
| 250 | |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 251 | // Contains owning pointers to all sessions that currently exist. |
[email protected] | 4d590c9c | 2014-05-02 05:14:33 | [diff] [blame] | 252 | SessionIdMap all_sessions_; |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 253 | // Contains non-owning pointers to currently active session |
| 254 | // (not going away session, once they're implemented). |
| 255 | SessionMap active_sessions_; |
[email protected] | eed749f9 | 2013-12-23 18:57:38 | [diff] [blame] | 256 | // Map from session to set of aliases that this session is known by. |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 257 | SessionAliasMap session_aliases_; |
[email protected] | eed749f9 | 2013-12-23 18:57:38 | [diff] [blame] | 258 | // Map from IP address to sessions which are connected to this address. |
| 259 | IPAliasMap ip_aliases_; |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 260 | |
[email protected] | d8e2abf8 | 2014-03-06 10:30:10 | [diff] [blame] | 261 | // Origins which have gone away recently. |
| 262 | AliasSet gone_away_aliases_; |
| 263 | |
[email protected] | fd276a28 | 2014-06-11 04:26:14 | [diff] [blame] | 264 | const QuicConfig config_; |
[email protected] | 59c0bbd | 2014-03-22 04:08:12 | [diff] [blame] | 265 | QuicCryptoClientConfig crypto_config_; |
[email protected] | b06431078 | 2013-05-30 21:12:17 | [diff] [blame] | 266 | |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 267 | JobMap active_jobs_; |
| 268 | JobRequestsMap job_requests_map_; |
| 269 | RequestMap active_requests_; |
| 270 | |
[email protected] | 1e96003 | 2013-12-20 19:00:20 | [diff] [blame] | 271 | QuicVersionVector supported_versions_; |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 272 | |
[email protected] | 376d38a | 2014-01-22 03:47:35 | [diff] [blame] | 273 | // Determine if we should consistently select a client UDP port. If false, |
| 274 | // then we will just let the OS select a random client port for each new |
| 275 | // connection. |
| 276 | bool enable_port_selection_; |
| 277 | |
jri | 2b966f2 | 2014-09-02 22:25:36 | [diff] [blame] | 278 | // Set if we always require handshake confirmation. If true, this will |
| 279 | // introduce at least one RTT for the handshake before the client sends data. |
| 280 | bool always_require_handshake_confirmation_; |
| 281 | |
jri | 584002d1 | 2014-09-09 00:51:28 | [diff] [blame] | 282 | // Set if we do not want connection pooling. |
| 283 | bool disable_connection_pooling_; |
| 284 | |
[email protected] | 337e145 | 2013-12-16 23:57:50 | [diff] [blame] | 285 | // Each profile will (probably) have a unique port_seed_ value. This value is |
| 286 | // used to help seed a pseudo-random number generator (PortSuggester) so that |
| 287 | // we consistently (within this profile) suggest the same ephemeral port when |
| 288 | // we re-connect to any given server/port. The differences between profiles |
| 289 | // (probablistically) prevent two profiles from colliding in their ephemeral |
| 290 | // port requests. |
| 291 | uint64 port_seed_; |
[email protected] | 7034cf1 | 2013-12-13 22:47:07 | [diff] [blame] | 292 | |
rtenneti | fc47e0e | 2014-09-26 02:54:05 | [diff] [blame] | 293 | // Local address of socket that was created in CreateSession. |
| 294 | IPEndPoint local_address_; |
| 295 | bool check_persisted_supports_quic_; |
| 296 | |
[email protected] | 1e96003 | 2013-12-20 19:00:20 | [diff] [blame] | 297 | base::WeakPtrFactory<QuicStreamFactory> weak_factory_; |
| 298 | |
[email protected] | e13201d8 | 2012-12-12 05:00:32 | [diff] [blame] | 299 | DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); |
| 300 | }; |
| 301 | |
| 302 | } // namespace net |
| 303 | |
| 304 | #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ |