blob: 08ec0942c2377a7b871ebfc6d4128ca675f0c941 [file] [log] [blame]
[email protected]e13201d82012-12-12 05:00:321// 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
Ryan Hamiltona3ee93a72018-08-01 22:03:085#ifndef NET_QUIC_QUIC_STREAM_FACTORY_H_
6#define NET_QUIC_QUIC_STREAM_FACTORY_H_
[email protected]e13201d82012-12-12 05:00:327
Avi Drissman13fc8932015-12-20 04:40:468#include <stddef.h>
9#include <stdint.h>
10
[email protected]1cd2a5f2014-03-14 06:33:2511#include <list>
[email protected]e13201d82012-12-12 05:00:3212#include <map>
bnc614a92d32016-04-04 13:56:0713#include <set>
[email protected]41d6b172013-01-29 16:10:5714#include <string>
[email protected]6e12d702013-11-13 00:17:1715#include <vector>
[email protected]e13201d82012-12-12 05:00:3216
thestiga0e18cd2015-09-25 04:58:3617#include "base/gtest_prod_util.h"
[email protected]e8cf7555b2014-02-28 23:52:5318#include "base/logging.h"
Avi Drissman13fc8932015-12-20 04:40:4619#include "base/macros.h"
[email protected]e13201d82012-12-12 05:00:3220#include "base/memory/weak_ptr.h"
Zhongyi Shic16b4102019-02-12 00:37:4021#include "base/time/tick_clock.h"
rtenneti8332ba52015-09-17 19:33:4122#include "base/time/time.h"
[email protected]e13201d82012-12-12 05:00:3223#include "net/base/address_list.h"
Bence Békyd8a21fc32018-06-27 18:29:5824#include "net/base/completion_once_callback.h"
[email protected]e13201d82012-12-12 05:00:3225#include "net/base/host_port_pair.h"
bnc81c46c1f2016-10-04 16:25:5926#include "net/base/net_export.h"
[email protected]f698a012013-05-06 20:18:5927#include "net/base/network_change_notifier.h"
Lily Houghton582d4622018-01-22 22:43:4028#include "net/base/proxy_server.h"
[email protected]d7d1e50b2013-11-25 22:08:0929#include "net/cert/cert_database.h"
zhongyi32569c62016-01-08 02:54:3030#include "net/http/http_server_properties.h"
xunjieli2608f9b2016-03-14 13:39:2331#include "net/http/http_stream_factory.h"
mikecironef22f9812016-10-04 03:40:1932#include "net/log/net_log_with_source.h"
Ryan Hamiltona3ee93a72018-08-01 22:03:0833#include "net/quic/network_connection.h"
34#include "net/quic/quic_chromium_client_session.h"
35#include "net/quic/quic_clock_skew_detector.h"
36#include "net/quic/quic_session_key.h"
Yixin Wang7f3cdc3f2017-11-10 01:44:1437#include "net/socket/client_socket_pool.h"
rch02d87792015-09-09 09:05:5338#include "net/ssl/ssl_config_service.h"
Victor Vasiliev6bb59d22019-03-08 21:34:5139#include "net/third_party/quiche/src/quic/core/http/quic_client_push_promise_index.h"
40#include "net/third_party/quiche/src/quic/core/quic_config.h"
41#include "net/third_party/quiche/src/quic/core/quic_crypto_stream.h"
42#include "net/third_party/quiche/src/quic/core/quic_packets.h"
43#include "net/third_party/quiche/src/quic/core/quic_server_id.h"
44#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
[email protected]e13201d82012-12-12 05:00:3245
mikecironef22f9812016-10-04 03:40:1946namespace base {
47class Value;
xunjieli69720dd2017-01-30 15:36:2948namespace trace_event {
49class ProcessMemoryDump;
50}
Ryan Hamiltona3ee93a72018-08-01 22:03:0851} // namespace base
mikecironef22f9812016-10-04 03:40:1952
Ryan Hamilton9835e662018-08-02 05:36:2753namespace quic {
54class QuicAlarmFactory;
55class QuicClock;
56class QuicRandom;
57} // namespace quic
58
[email protected]e13201d82012-12-12 05:00:3259namespace net {
60
estark6f9b3d82016-01-12 21:37:0561class CTPolicyEnforcer;
[email protected]6d1b4ed2013-07-10 03:57:5462class CertVerifier;
[email protected]e13201d82012-12-12 05:00:3263class ClientSocketFactory;
rtenneti052774e2015-11-24 21:00:1264class CTVerifier;
[email protected]6d1b4ed2013-07-10 03:57:5465class HostResolver;
[email protected]77c6c162013-08-17 02:57:4566class HttpServerProperties;
mikecironef22f9812016-10-04 03:40:1967class NetLog;
Matt Menke26e41542019-06-05 01:09:5168class NetworkIsolationKey;
rch12fef552016-01-15 16:26:3169class QuicChromiumConnectionHelper;
[email protected]e8ff26842013-03-22 21:02:0570class QuicCryptoClientStreamFactory;
rtenneti13c9d38d2015-10-12 21:25:0171class QuicServerInfo;
[email protected]e13201d82012-12-12 05:00:3272class QuicStreamFactory;
tbansalfdf5665b2015-09-21 22:46:4073class SocketPerformanceWatcherFactory;
Paul Jensen8e3c5d32018-02-19 17:06:3374class SocketTag;
[email protected]080b77932014-08-04 01:22:4675class TransportSecurityState;
[email protected]e13201d82012-12-12 05:00:3276
[email protected]c49ff182013-09-28 08:33:2677namespace test {
78class QuicStreamFactoryPeer;
79} // namespace test
80
rtenneti41c09992015-11-30 18:24:0181// When a connection is idle for 30 seconds it will be closed.
Ryan Sleevi2e8255b2019-07-17 21:02:2182constexpr base::TimeDelta kIdleConnectionTimeout =
83 base::TimeDelta::FromSeconds(30);
rtenneti41c09992015-11-30 18:24:0184
Zhongyi Shic16b4102019-02-12 00:37:4085// Sessions can migrate if they have been idle for less than this period.
Ryan Sleevi2e8255b2019-07-17 21:02:2186constexpr base::TimeDelta kDefaultIdleSessionMigrationPeriod =
87 base::TimeDelta::FromSeconds(30);
Zhongyi Shic16b4102019-02-12 00:37:4088
Zhongyi Shi99d0cdd2019-05-21 01:18:4289// The default maximum time allowed to have no retransmittable packets on the
90// wire (after sending the first retransmittable packet) if
Zhongyi Shie01f2db2019-02-22 19:53:2391// |migrate_session_early_v2_| is true. PING frames will be sent as needed to
92// enforce this.
Ryan Sleevi2e8255b2019-07-17 21:02:2193constexpr base::TimeDelta kDefaultRetransmittableOnWireTimeout =
94 base::TimeDelta::FromMilliseconds(100);
Zhongyi Shie01f2db2019-02-22 19:53:2395
Zhongyi Shi0e52ce72018-03-20 22:31:0096// The default maximum time QUIC session could be on non-default network before
97// migrate back to default network.
Ryan Sleevi2e8255b2019-07-17 21:02:2198constexpr base::TimeDelta kMaxTimeOnNonDefaultNetwork =
99 base::TimeDelta::FromSeconds(128);
Zhongyi Shi0e52ce72018-03-20 22:31:00100
Zhongyi Shiee760762018-08-01 00:54:29101// The default maximum number of migrations to non default network on write
102// error per network.
103const int64_t kMaxMigrationsToNonDefaultNetworkOnWriteError = 5;
104
Zhongyi Shi0e52ce72018-03-20 22:31:00105// The default maximum number of migrations to non default network on path
Zhongyi Shiee760762018-08-01 00:54:29106// degrading per network.
Zhongyi Shi0e52ce72018-03-20 22:31:00107const int64_t kMaxMigrationsToNonDefaultNetworkOnPathDegrading = 5;
108
Nick Harper72ade192019-07-17 03:30:42109// Structure containing simple configuration options and experiments for QUIC.
110struct NET_EXPORT QuicParams {
111 QuicParams();
112 QuicParams(const QuicParams& other);
113 ~QuicParams();
114
115 // QUIC runtime configuration options.
116
117 // Versions of QUIC which may be used.
118 quic::ParsedQuicVersionVector supported_versions;
119 // User agent description to send in the QUIC handshake.
120 std::string user_agent_id;
121 // Limit on the size of QUIC packets.
122 size_t max_packet_length;
123 // Maximum number of server configs that are to be stored in
124 // HttpServerProperties, instead of the disk cache.
Ryan Sleevi2e8255b2019-07-17 21:02:21125 size_t max_server_configs_stored_in_properties = 0u;
Nick Harper72ade192019-07-17 03:30:42126 // QUIC will be used for all connections in this set.
127 std::set<HostPortPair> origins_to_force_quic_on;
128 // Set of QUIC tags to send in the handshake's connection options.
129 quic::QuicTagVector connection_options;
130 // Set of QUIC tags to send in the handshake's connection options that only
131 // affect the client.
132 quic::QuicTagVector client_connection_options;
133 // Enables experimental optimization for receiving data in UDPSocket.
Ryan Sleevi2e8255b2019-07-17 21:02:21134 bool enable_socket_recv_optimization = false;
Bence Béky1ceba552019-07-19 17:11:05135 // Initial value of QuicSpdyClientSessionBase::max_allowed_push_id_.
136 quic::QuicStreamId max_allowed_push_id = 0;
Nick Harper72ade192019-07-17 03:30:42137
138 // Active QUIC experiments
139
Nick Harper72ade192019-07-17 03:30:42140 // Retry requests which fail with QUIC_PROTOCOL_ERROR, and mark QUIC
141 // broken if the retry succeeds.
Ryan Sleevi2e8255b2019-07-17 21:02:21142 bool retry_without_alt_svc_on_quic_errors = true;
Nick Harper72ade192019-07-17 03:30:42143 // If true, alt-svc headers advertising QUIC in IETF format will be
144 // supported.
Ryan Sleevi2e8255b2019-07-17 21:02:21145 bool support_ietf_format_quic_altsvc = false;
Nick Harper72ade192019-07-17 03:30:42146 // If true, all QUIC sessions are closed when any local IP address changes.
Ryan Sleevi2e8255b2019-07-17 21:02:21147 bool close_sessions_on_ip_change = false;
Nick Harper72ade192019-07-17 03:30:42148 // If true, all QUIC sessions are marked as goaway when any local IP address
149 // changes.
Ryan Sleevi2e8255b2019-07-17 21:02:21150 bool goaway_sessions_on_ip_change = false;
Nick Harper72ade192019-07-17 03:30:42151 // Specifies QUIC idle connection state lifetime.
Ryan Sleevi2e8255b2019-07-17 21:02:21152 base::TimeDelta idle_connection_timeout = kIdleConnectionTimeout;
Nick Harper72ade192019-07-17 03:30:42153 // Specifies the reduced ping timeout subsequent connections should use when
154 // a connection was timed out with open streams.
Ryan Sleevi2e8255b2019-07-17 21:02:21155 base::TimeDelta reduced_ping_timeout;
Nick Harper72ade192019-07-17 03:30:42156 // Maximum time that a session can have no retransmittable packets on the
157 // wire. Set to zero if not specified and no retransmittable PING will be
158 // sent to peer when the wire has no retransmittable packets.
Ryan Sleevi2e8255b2019-07-17 21:02:21159 base::TimeDelta retransmittable_on_wire_timeout;
Nick Harper72ade192019-07-17 03:30:42160 // Maximum time the session can be alive before crypto handshake is
161 // finished.
Ryan Sleevi2e8255b2019-07-17 21:02:21162 base::TimeDelta max_time_before_crypto_handshake;
Nick Harper72ade192019-07-17 03:30:42163 // Maximum idle time before the crypto handshake has completed.
Ryan Sleevi2e8255b2019-07-17 21:02:21164 base::TimeDelta max_idle_time_before_crypto_handshake;
Nick Harper72ade192019-07-17 03:30:42165 // If true, connection migration v2 will be used to migrate existing
166 // sessions to network when the platform indicates that the default network
167 // is changing.
Ryan Sleevi2e8255b2019-07-17 21:02:21168 bool migrate_sessions_on_network_change_v2 = false;
Nick Harper72ade192019-07-17 03:30:42169 // If true, connection migration v2 may be used to migrate active QUIC
170 // sessions to alternative network if current network connectivity is poor.
Ryan Sleevi2e8255b2019-07-17 21:02:21171 bool migrate_sessions_early_v2 = false;
Nick Harper72ade192019-07-17 03:30:42172 // If true, a new connection may be kicked off on an alternate network when
173 // a connection fails on the default network before handshake is confirmed.
Ryan Sleevi2e8255b2019-07-17 21:02:21174 bool retry_on_alternate_network_before_handshake = false;
Nick Harper72ade192019-07-17 03:30:42175 // If true, an idle session will be migrated within the idle migration
176 // period.
Ryan Sleevi2e8255b2019-07-17 21:02:21177 bool migrate_idle_sessions = false;
Zhongyi Shiaf38c4e42019-08-29 22:49:05178 // If true, sessions with open streams will attempt to migrate to a different
179 // port when the current path is poor.
180 bool allow_port_migration = false;
Nick Harper72ade192019-07-17 03:30:42181 // A session can be migrated if its idle time is within this period.
Ryan Sleevi2e8255b2019-07-17 21:02:21182 base::TimeDelta idle_session_migration_period =
183 kDefaultIdleSessionMigrationPeriod;
Nick Harper72ade192019-07-17 03:30:42184 // Maximum time the session could be on the non-default network before
185 // migrates back to default network. Defaults to
186 // kMaxTimeOnNonDefaultNetwork.
Ryan Sleevi2e8255b2019-07-17 21:02:21187 base::TimeDelta max_time_on_non_default_network = kMaxTimeOnNonDefaultNetwork;
Nick Harper72ade192019-07-17 03:30:42188 // Maximum number of migrations to the non-default network on write error
189 // per network for each session.
Ryan Sleevi2e8255b2019-07-17 21:02:21190 int max_migrations_to_non_default_network_on_write_error =
191 kMaxMigrationsToNonDefaultNetworkOnWriteError;
Nick Harper72ade192019-07-17 03:30:42192 // Maximum number of migrations to the non-default network on path
193 // degrading per network for each session.
Ryan Sleevi2e8255b2019-07-17 21:02:21194 int max_migrations_to_non_default_network_on_path_degrading =
195 kMaxMigrationsToNonDefaultNetworkOnPathDegrading;
Nick Harper72ade192019-07-17 03:30:42196 // If true, allows migration of QUIC connections to a server-specified
197 // alternate server address.
Ryan Sleevi2e8255b2019-07-17 21:02:21198 bool allow_server_migration = false;
Nick Harper72ade192019-07-17 03:30:42199 // If true, allows QUIC to use alternative services with a different
200 // hostname from the origin.
Ryan Sleevi2e8255b2019-07-17 21:02:21201 bool allow_remote_alt_svc = true;
Nick Harper72ade192019-07-17 03:30:42202 // If true, the quic stream factory may race connection from stale dns
203 // result with the original dns resolution
Ryan Sleevi2e8255b2019-07-17 21:02:21204 bool race_stale_dns_on_connection = false;
Nick Harper72ade192019-07-17 03:30:42205 // If true, the quic session may mark itself as GOAWAY on path degrading.
Ryan Sleevi2e8255b2019-07-17 21:02:21206 bool go_away_on_path_degrading = false;
Nick Harper72ade192019-07-17 03:30:42207 // If true, bidirectional streams over QUIC will be disabled.
Ryan Sleevi2e8255b2019-07-17 21:02:21208 bool disable_bidirectional_streams = false;
Nick Harper72ade192019-07-17 03:30:42209 // If true, race cert verification with host resolution.
Ryan Sleevi2e8255b2019-07-17 21:02:21210 bool race_cert_verification = false;
Nick Harper72ade192019-07-17 03:30:42211 // If true, estimate the initial RTT for QUIC connections based on network.
Ryan Sleevi2e8255b2019-07-17 21:02:21212 bool estimate_initial_rtt = false;
Nick Harper72ade192019-07-17 03:30:42213 // If true, client headers will include HTTP/2 stream dependency info
214 // derived from the request priority.
Ryan Sleevi2e8255b2019-07-17 21:02:21215 bool headers_include_h2_stream_dependency = false;
Nick Harper72ade192019-07-17 03:30:42216 // The initial rtt that will be used in crypto handshake if no cached
217 // smoothed rtt is present.
Ryan Sleevi2e8255b2019-07-17 21:02:21218 base::TimeDelta initial_rtt_for_handshake;
Nick Harper72ade192019-07-17 03:30:42219};
220
Zhongyi Shib4737c62017-09-28 00:49:31221enum QuicPlatformNotification {
222 NETWORK_CONNECTED,
223 NETWORK_MADE_DEFAULT,
224 NETWORK_DISCONNECTED,
225 NETWORK_SOON_TO_DISCONNECT,
226 NETWORK_IP_ADDRESS_CHANGED,
227 NETWORK_NOTIFICATION_MAX
228};
229
Yixin Wang7891a39d2017-11-08 20:59:24230// Encapsulates a pending request for a QuicChromiumClientSession.
[email protected]e13201d82012-12-12 05:00:32231// If the request is still pending when it is destroyed, it will
232// cancel the request with the factory.
233class NET_EXPORT_PRIVATE QuicStreamRequest {
234 public:
zhongyi98d6a9262017-05-19 02:47:45235 explicit QuicStreamRequest(QuicStreamFactory* factory);
[email protected]e13201d82012-12-12 05:00:32236 ~QuicStreamRequest();
237
rtennetia75df622015-06-21 23:59:50238 // |cert_verify_flags| is bitwise OR'd of CertVerifier::VerifyFlags and it is
239 // passed to CertVerifier::Verify.
bnc359ed2a2016-04-29 20:43:45240 // |destination| will be resolved and resulting IPEndPoint used to open a
Ryan Hamilton8d9ee76e2018-05-29 23:52:52241 // quic::QuicConnection. This can be different than
242 // HostPortPair::FromURL(url).
bnc359ed2a2016-04-29 20:43:45243 int Request(const HostPortPair& destination,
Ryan Hamilton9ef8c102019-06-28 03:58:52244 quic::ParsedQuicVersion quic_version,
[email protected]9dd3ff0f2014-03-26 09:51:28245 PrivacyMode privacy_mode,
Yixin Wang247ea642017-11-15 01:15:50246 RequestPriority priority,
Paul Jensen8e3c5d32018-02-19 17:06:33247 const SocketTag& socket_tag,
Matt Menke26e41542019-06-05 01:09:51248 const NetworkIsolationKey& network_isolation_key,
rtennetia75df622015-06-21 23:59:50249 int cert_verify_flags,
ckrasic3865ee0f2016-02-29 22:04:56250 const GURL& url,
tfarina42834112016-09-22 13:38:20251 const NetLogWithSource& net_log,
Ryan Hamilton75f197262017-08-17 14:00:07252 NetErrorDetails* net_error_details,
Zhongyi Shia6b68d112018-09-24 07:49:03253 CompletionOnceCallback failed_on_default_network_callback,
Bence Békyd8a21fc32018-06-27 18:29:58254 CompletionOnceCallback callback);
[email protected]e13201d82012-12-12 05:00:32255
Yixin Wang7c5d11a82017-12-21 02:40:00256 // This function must be called after Request() returns ERR_IO_PENDING.
257 // Returns true if Request() requires host resolution and it hasn't completed
258 // yet. If true is returned, |callback| will run when host resolution
259 // completes. It will be called with the result after host resolution during
260 // the connection process. For example, if host resolution returns OK and then
261 // crypto handshake returns ERR_IO_PENDING, then |callback| will run with
262 // ERR_IO_PENDING.
Bence Békyd8a21fc32018-06-27 18:29:58263 bool WaitForHostResolution(CompletionOnceCallback callback);
Yixin Wang7c5d11a82017-12-21 02:40:00264
265 // Tells QuicStreamRequest it should expect OnHostResolutionComplete()
266 // to be called in the future.
267 void ExpectOnHostResolution();
268
269 // Will be called by the associated QuicStreamFactory::Job when host
270 // resolution completes asynchronously after Request().
271 void OnHostResolutionComplete(int rv);
272
[email protected]e13201d82012-12-12 05:00:32273 void OnRequestComplete(int rv);
274
Zhongyi Shia6b68d112018-09-24 07:49:03275 // Called when the original connection created on the default network for
276 // |this| fails and a new connection has been created on the alternate
277 // network.
278 void OnConnectionFailedOnDefaultNetwork();
279
rtenneti8332ba52015-09-17 19:33:41280 // Helper method that calls |factory_|'s GetTimeDelayForWaitingJob(). It
281 // returns the amount of time waiting job should be delayed.
282 base::TimeDelta GetTimeDelayForWaitingJob() const;
283
Lily Chenf11e1292018-11-29 16:42:09284 // If host resolution is underway, changes the priority of the host resolver
285 // request.
286 void SetPriority(RequestPriority priority);
287
Yixin Wang7891a39d2017-11-08 20:59:24288 // Releases the handle to the QUIC session retrieved as a result of Request().
289 std::unique_ptr<QuicChromiumClientSession::Handle> ReleaseSessionHandle();
xunjieli2608f9b2016-03-14 13:39:23290
291 // Sets |session_|.
rchf0b18c8a2017-05-05 19:31:57292 void SetSession(std::unique_ptr<QuicChromiumClientSession::Handle> session);
[email protected]e13201d82012-12-12 05:00:32293
Ryan Hamilton75f197262017-08-17 14:00:07294 NetErrorDetails* net_error_details() { return net_error_details_; }
295
Paul Jensen8e3c5d32018-02-19 17:06:33296 const QuicSessionKey& session_key() const { return session_key_; }
bnccb7ff3c2015-05-21 20:51:55297
tfarina42834112016-09-22 13:38:20298 const NetLogWithSource& net_log() const { return net_log_; }
[email protected]e13201d82012-12-12 05:00:32299
300 private:
301 QuicStreamFactory* factory_;
Paul Jensen8e3c5d32018-02-19 17:06:33302 QuicSessionKey session_key_;
tfarina42834112016-09-22 13:38:20303 NetLogWithSource net_log_;
Bence Békyd8a21fc32018-06-27 18:29:58304 CompletionOnceCallback callback_;
Zhongyi Shia6b68d112018-09-24 07:49:03305 CompletionOnceCallback failed_on_default_network_callback_;
Ryan Hamilton75f197262017-08-17 14:00:07306 NetErrorDetails* net_error_details_; // Unowned.
rchf0b18c8a2017-05-05 19:31:57307 std::unique_ptr<QuicChromiumClientSession::Handle> session_;
[email protected]e13201d82012-12-12 05:00:32308
Yixin Wang7c5d11a82017-12-21 02:40:00309 // Set in Request(). If true, then OnHostResolutionComplete() is expected to
310 // be called in the future.
311 bool expect_on_host_resolution_;
312 // Callback passed to WaitForHostResolution().
Bence Békyd8a21fc32018-06-27 18:29:58313 CompletionOnceCallback host_resolution_callback_;
Yixin Wang7c5d11a82017-12-21 02:40:00314
[email protected]e13201d82012-12-12 05:00:32315 DISALLOW_COPY_AND_ASSIGN(QuicStreamRequest);
316};
317
Yixin Wang7891a39d2017-11-08 20:59:24318// A factory for fetching QuicChromiumClientSessions.
[email protected]f698a012013-05-06 20:18:59319class NET_EXPORT_PRIVATE QuicStreamFactory
[email protected]d7d1e50b2013-11-25 22:08:09320 : public NetworkChangeNotifier::IPAddressObserver,
jri7e636642016-01-14 06:57:08321 public NetworkChangeNotifier::NetworkObserver,
[email protected]d7d1e50b2013-11-25 22:08:09322 public CertDatabase::Observer {
[email protected]e13201d82012-12-12 05:00:32323 public:
bnc359ed2a2016-04-29 20:43:45324 // This class encompasses |destination| and |server_id|.
325 // |destination| is a HostPortPair which is resolved
Ryan Hamilton8d9ee76e2018-05-29 23:52:52326 // and a quic::QuicConnection is made to the resulting IP address.
bnc359ed2a2016-04-29 20:43:45327 // |server_id| identifies the origin of the request,
328 // the crypto handshake advertises |server_id.host()| to the server,
329 // and the certificate is also matched against |server_id.host()|.
Paul Jensen8e3c5d32018-02-19 17:06:33330 class NET_EXPORT_PRIVATE QuicSessionAliasKey {
bnc359ed2a2016-04-29 20:43:45331 public:
Paul Jensen8e3c5d32018-02-19 17:06:33332 QuicSessionAliasKey() = default;
333 QuicSessionAliasKey(const HostPortPair& destination,
334 const QuicSessionKey& session_key);
335 ~QuicSessionAliasKey() = default;
bnc359ed2a2016-04-29 20:43:45336
337 // Needed to be an element of std::set.
Paul Jensen8e3c5d32018-02-19 17:06:33338 bool operator<(const QuicSessionAliasKey& other) const;
339 bool operator==(const QuicSessionAliasKey& other) const;
bnc359ed2a2016-04-29 20:43:45340
341 const HostPortPair& destination() const { return destination_; }
Ryan Hamilton8d9ee76e2018-05-29 23:52:52342 const quic::QuicServerId& server_id() const {
343 return session_key_.server_id();
344 }
Paul Jensen8e3c5d32018-02-19 17:06:33345 const QuicSessionKey& session_key() const { return session_key_; }
bnc359ed2a2016-04-29 20:43:45346
xunjieli69720dd2017-01-30 15:36:29347 // Returns the estimate of dynamically allocated memory in bytes.
348 size_t EstimateMemoryUsage() const;
349
bnc359ed2a2016-04-29 20:43:45350 private:
351 HostPortPair destination_;
Paul Jensen8e3c5d32018-02-19 17:06:33352 QuicSessionKey session_key_;
bnc359ed2a2016-04-29 20:43:45353 };
354
[email protected]e8ff26842013-03-22 21:02:05355 QuicStreamFactory(
jridf673d22016-06-02 22:06:33356 NetLog* net_log,
[email protected]e8ff26842013-03-22 21:02:05357 HostResolver* host_resolver,
nharper642ae4b2016-06-30 00:40:36358 SSLConfigService* ssl_config_service,
[email protected]e8ff26842013-03-22 21:02:05359 ClientSocketFactory* client_socket_factory,
bnc525e175a2016-06-20 12:36:40360 HttpServerProperties* http_server_properties,
[email protected]59c0bbd2014-03-22 04:08:12361 CertVerifier* cert_verifier,
estark6f9b3d82016-01-12 21:37:05362 CTPolicyEnforcer* ct_policy_enforcer,
[email protected]080b77932014-08-04 01:22:46363 TransportSecurityState* transport_security_state,
rtenneti052774e2015-11-24 21:00:12364 CTVerifier* cert_transparency_verifier,
tbansalc8a94ea2015-11-02 23:58:51365 SocketPerformanceWatcherFactory* socket_performance_watcher_factory,
[email protected]e8ff26842013-03-22 21:02:05366 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory,
Ryan Hamilton8d9ee76e2018-05-29 23:52:52367 quic::QuicRandom* random_generator,
368 quic::QuicClock* clock,
Nick Harper72ade192019-07-17 03:30:42369 const QuicParams& params);
dchengb03027d2014-10-21 12:00:20370 ~QuicStreamFactory() override;
[email protected]e13201d82012-12-12 05:00:32371
Paul Jensen8e3c5d32018-02-19 17:06:33372 // Returns true if there is an existing session for |session_key| or if the
bnc359ed2a2016-04-29 20:43:45373 // request can be pooled to an existing session to the IP address of
374 // |destination|.
Paul Jensen8e3c5d32018-02-19 17:06:33375 bool CanUseExistingSession(const QuicSessionKey& session_key,
bnc359ed2a2016-04-29 20:43:45376 const HostPortPair& destination);
zhongyi32569c62016-01-08 02:54:30377
Yixin Wang7891a39d2017-11-08 20:59:24378 // Fetches a QuicChromiumClientSession to |host_port_pair| which will be
rchf114d982015-10-21 01:34:56379 // owned by |request|.
[email protected]0cceb922014-07-01 02:00:56380 // If a matching session already exists, this method will return OK. If no
381 // matching session exists, this will return ERR_IO_PENDING and will invoke
382 // OnRequestComplete asynchronously.
Paul Jensen8e3c5d32018-02-19 17:06:33383 int Create(const QuicSessionKey& session_key,
bnc359ed2a2016-04-29 20:43:45384 const HostPortPair& destination,
Ryan Hamilton9ef8c102019-06-28 03:58:52385 quic::ParsedQuicVersion quic_version,
Yixin Wang247ea642017-11-15 01:15:50386 RequestPriority priority,
rtennetia75df622015-06-21 23:59:50387 int cert_verify_flags,
ckrasic3865ee0f2016-02-29 22:04:56388 const GURL& url,
tfarina42834112016-09-22 13:38:20389 const NetLogWithSource& net_log,
[email protected]e13201d82012-12-12 05:00:32390 QuicStreamRequest* request);
391
[email protected]4d283b32013-10-17 12:57:27392 // Called by a session when it is going away and no more streams should be
393 // created on it.
ckrasic4f9d88d2015-07-22 22:23:16394 void OnSessionGoingAway(QuicChromiumClientSession* session);
[email protected]4d283b32013-10-17 12:57:27395
[email protected]e13201d82012-12-12 05:00:32396 // Called by a session after it shuts down.
ckrasic4f9d88d2015-07-22 22:23:16397 void OnSessionClosed(QuicChromiumClientSession* session);
[email protected]e13201d82012-12-12 05:00:32398
rch9ecde09b2017-04-08 00:18:23399 // Called by a session when it blackholes after the handshake is confirmed.
400 void OnBlackholeAfterHandshakeConfirmed(QuicChromiumClientSession* session);
zhongyidd1439f62016-09-02 02:02:26401
[email protected]e13201d82012-12-12 05:00:32402 // Cancels a pending request.
403 void CancelRequest(QuicStreamRequest* request);
404
Lily Chenf11e1292018-11-29 16:42:09405 // Sets priority of a request.
406 void SetRequestPriority(QuicStreamRequest* request, RequestPriority priority);
407
Renjieba55fae2018-09-20 03:05:16408 // Closes all current sessions with specified network, QUIC error codes.
409 // It sends connection close packet when closing connections.
Ryan Hamilton8d9ee76e2018-05-29 23:52:52410 void CloseAllSessions(int error, quic::QuicErrorCode quic_error);
[email protected]56dfb902013-01-03 23:17:55411
danakjad1777e2016-04-16 00:56:42412 std::unique_ptr<base::Value> QuicStreamFactoryInfoToValue() const;
[email protected]c5b061b2013-01-05 00:31:34413
msramek992625ec2016-08-04 18:33:58414 // Delete cached state objects in |crypto_config_|. If |origin_filter| is not
415 // null, only objects on matching origins will be deleted.
416 void ClearCachedStatesInCryptoConfig(
417 const base::Callback<bool(const GURL&)>& origin_filter);
[email protected]f7e21a432014-04-21 22:17:57418
jri7e636642016-01-14 06:57:08419 // Helper method that configures a DatagramClientSocket. Socket is
420 // bound to the default network if the |network| param is
421 // NetworkChangeNotifier::kInvalidNetworkHandle.
422 // Returns net_error code.
423 int ConfigureSocket(DatagramClientSocket* socket,
424 IPEndPoint addr,
Paul Jensen8e3c5d32018-02-19 17:06:33425 NetworkChangeNotifier::NetworkHandle network,
426 const SocketTag& socket_tag);
jri7e636642016-01-14 06:57:08427
jriae8cfdc2016-01-21 19:44:35428 // Finds an alternative to |old_network| from the platform's list of connected
429 // networks. Returns NetworkChangeNotifier::kInvalidNetworkHandle if no
430 // alternative is found.
431 NetworkChangeNotifier::NetworkHandle FindAlternateNetwork(
432 NetworkChangeNotifier::NetworkHandle old_network);
433
Zhongyi Shi673f22ef2017-10-18 00:00:47434 // Creates a datagram socket. |source| is the NetLogSource for the entity
435 // trying to create the socket, if it has one.
436 std::unique_ptr<DatagramClientSocket> CreateSocket(
437 NetLog* net_log,
438 const NetLogSource& source);
439
[email protected]f698a012013-05-06 20:18:59440 // NetworkChangeNotifier::IPAddressObserver methods:
441
Jana Iyengar903dec22017-11-28 00:44:23442 // Until the servers support roaming, close all connections when the local
443 // IP address changes.
dchengb03027d2014-10-21 12:00:20444 void OnIPAddressChanged() override;
[email protected]f698a012013-05-06 20:18:59445
jri7e636642016-01-14 06:57:08446 // NetworkChangeNotifier::NetworkObserver methods:
447 void OnNetworkConnected(
448 NetworkChangeNotifier::NetworkHandle network) override;
449 void OnNetworkDisconnected(
450 NetworkChangeNotifier::NetworkHandle network) override;
451 void OnNetworkSoonToDisconnect(
452 NetworkChangeNotifier::NetworkHandle network) override;
453 void OnNetworkMadeDefault(
454 NetworkChangeNotifier::NetworkHandle network) override;
455
[email protected]d7d1e50b2013-11-25 22:08:09456 // CertDatabase::Observer methods:
457
458 // We close all sessions when certificate database is changed.
mattmfd05a1f2017-02-18 06:18:44459 void OnCertDBChanged() override;
[email protected]d7d1e50b2013-11-25 22:08:09460
Matt Menkeb566c392019-09-11 23:22:43461 bool is_quic_known_to_work_on_current_network() const {
462 return is_quic_known_to_work_on_current_network_;
463 }
[email protected]11c05872013-08-20 02:04:12464
Nick Harper72ade192019-07-17 03:30:42465 bool allow_server_migration() const { return params_.allow_server_migration; }
Zhongyi Shif124a582017-11-02 00:15:04466
Matt Menkeb566c392019-09-11 23:22:43467 void set_is_quic_known_to_work_on_current_network(
468 bool is_quic_known_to_work_on_current_network);
[email protected]11c05872013-08-20 02:04:12469
rtenneti8332ba52015-09-17 19:33:41470 // It returns the amount of time waiting job should be delayed.
Ryan Hamilton8d9ee76e2018-05-29 23:52:52471 base::TimeDelta GetTimeDelayForWaitingJob(
Matt Menke19475f72019-08-21 18:57:44472 const quic::QuicServerId& server_id,
473 const NetworkIsolationKey& network_isolation_key);
rtenneti8332ba52015-09-17 19:33:41474
rch12fef552016-01-15 16:26:31475 QuicChromiumConnectionHelper* helper() { return helper_.get(); }
[email protected]2cfc6bb82013-10-27 03:40:44476
Ryan Hamilton8d9ee76e2018-05-29 23:52:52477 quic::QuicAlarmFactory* alarm_factory() { return alarm_factory_.get(); }
rch16c74d1d2016-04-22 06:14:07478
zhongyiaf257542016-12-19 03:36:01479 void set_server_push_delegate(ServerPushDelegate* push_delegate) {
480 push_delegate_ = push_delegate;
481 }
482
Zhongyi Shi8de43832018-08-15 23:40:00483 NetworkChangeNotifier::NetworkHandle default_network() const {
484 return default_network_;
485 }
486
xunjieli69720dd2017-01-30 15:36:29487 // Dumps memory allocation stats. |parent_dump_absolute_name| is the name
488 // used by the parent MemoryAllocatorDump in the memory dump hierarchy.
489 void DumpMemoryStats(base::trace_event::ProcessMemoryDump* pmd,
490 const std::string& parent_absolute_name) const;
491
[email protected]e13201d82012-12-12 05:00:32492 private:
493 class Job;
rtennetid073dd22016-08-04 01:58:33494 class CertVerifierJob;
[email protected]c49ff182013-09-28 08:33:26495 friend class test::QuicStreamFactoryPeer;
[email protected]e13201d82012-12-12 05:00:32496
Paul Jensen8e3c5d32018-02-19 17:06:33497 typedef std::map<QuicSessionKey, QuicChromiumClientSession*> SessionMap;
498 typedef std::map<QuicChromiumClientSession*, QuicSessionAliasKey>
499 SessionIdMap;
500 typedef std::set<QuicSessionAliasKey> AliasSet;
ckrasic4f9d88d2015-07-22 22:23:16501 typedef std::map<QuicChromiumClientSession*, AliasSet> SessionAliasMap;
502 typedef std::set<QuicChromiumClientSession*> SessionSet;
rchf114d982015-10-21 01:34:56503 typedef std::map<IPEndPoint, SessionSet> IPAliasMap;
jri94ddc3142016-08-26 01:32:43504 typedef std::map<QuicChromiumClientSession*, IPEndPoint> SessionPeerIPMap;
Paul Jensen8e3c5d32018-02-19 17:06:33505 typedef std::map<QuicSessionKey, std::unique_ptr<Job>> JobMap;
Ryan Hamilton8d9ee76e2018-05-29 23:52:52506 typedef std::map<quic::QuicServerId, std::unique_ptr<CertVerifierJob>>
rtennetid073dd22016-08-04 01:58:33507 CertVerifierJobMap;
rtenneti14abd312015-02-06 21:56:01508
Paul Jensen8e3c5d32018-02-19 17:06:33509 bool HasMatchingIpSession(const QuicSessionAliasKey& key,
Yixin Wang7c5d11a82017-12-21 02:40:00510 const AddressList& address_list);
[email protected]e13201d82012-12-12 05:00:32511 void OnJobComplete(Job* job, int rv);
rtennetid073dd22016-08-04 01:58:33512 void OnCertVerifyJobComplete(CertVerifierJob* job, int rv);
Paul Jensen8e3c5d32018-02-19 17:06:33513 bool HasActiveSession(const QuicSessionKey& session_key) const;
514 bool HasActiveJob(const QuicSessionKey& session_key) const;
Ryan Hamilton8d9ee76e2018-05-29 23:52:52515 bool HasActiveCertVerifierJob(const quic::QuicServerId& server_id) const;
Paul Jensen8e3c5d32018-02-19 17:06:33516 int CreateSession(const QuicSessionAliasKey& key,
Ryan Hamilton9ef8c102019-06-28 03:58:52517 quic::ParsedQuicVersion quic_version,
rtennetia75df622015-06-21 23:59:50518 int cert_verify_flags,
rch433bf5f2017-02-14 04:10:47519 bool require_confirmation,
[email protected]338e7982013-12-13 11:15:32520 const AddressList& address_list,
xunjieli100937eb52016-09-15 20:09:37521 base::TimeTicks dns_resolution_start_time,
rtennetif4f08852015-02-27 17:50:04522 base::TimeTicks dns_resolution_end_time,
tfarina42834112016-09-22 13:38:20523 const NetLogWithSource& net_log,
Zhongyi Shi55ec9532018-07-24 03:57:39524 QuicChromiumClientSession** session,
525 NetworkChangeNotifier::NetworkHandle* network);
Paul Jensen8e3c5d32018-02-19 17:06:33526 void ActivateSession(const QuicSessionAliasKey& key,
ckrasic4f9d88d2015-07-22 22:23:16527 QuicChromiumClientSession* session);
Charles 'Buck' Krasic71763c9f2018-02-16 02:37:28528 void MarkAllActiveSessionsGoingAway();
[email protected]e13201d82012-12-12 05:00:32529
Matt Menke19475f72019-08-21 18:57:44530 void ConfigureInitialRttEstimate(
531 const quic::QuicServerId& server_id,
532 const NetworkIsolationKey& network_isolation_key,
533 quic::QuicConfig* config);
rchd6163f32017-01-30 23:50:38534
rtenneti2912825c2015-01-06 01:19:46535 // Returns |srtt| in micro seconds from ServerNetworkStats. Returns 0 if there
536 // is no |http_server_properties_| or if |http_server_properties_| doesn't
537 // have ServerNetworkStats for the given |server_id|.
Avi Drissman13fc8932015-12-20 04:40:46538 int64_t GetServerNetworkStatsSmoothedRttInMicroseconds(
Matt Menke19475f72019-08-21 18:57:44539 const quic::QuicServerId& server_id,
540 const NetworkIsolationKey& network_isolation_key) const;
rtenneti2912825c2015-01-06 01:19:46541
rchd6163f32017-01-30 23:50:38542 // Returns |srtt| from ServerNetworkStats. Returns null if there
543 // is no |http_server_properties_| or if |http_server_properties_| doesn't
544 // have ServerNetworkStats for the given |server_id|.
545 const base::TimeDelta* GetServerNetworkStatsSmoothedRtt(
Matt Menke19475f72019-08-21 18:57:44546 const quic::QuicServerId& server_id,
547 const NetworkIsolationKey& network_isolation_key) const;
rchd6163f32017-01-30 23:50:38548
bnccacc0992015-03-20 20:22:22549 // Helper methods.
Matt Menkeb32ba5122019-09-10 19:17:05550 bool WasQuicRecentlyBroken(const QuicSessionKey& session_key) const;
rtenneti8332ba52015-09-17 19:33:41551
Ryan Hamilton8d9ee76e2018-05-29 23:52:52552 bool CryptoConfigCacheIsEmpty(const quic::QuicServerId& server_id);
rtenneti14abd312015-02-06 21:56:01553
rtennetid073dd22016-08-04 01:58:33554 // Starts an asynchronous job for cert verification if
Nick Harper72ade192019-07-17 03:30:42555 // |params_.race_cert_verification| is enabled and if there are cached certs
556 // for the given |server_id|.
Ryan Hamilton8d9ee76e2018-05-29 23:52:52557 quic::QuicAsyncStatus StartCertVerifyJob(const quic::QuicServerId& server_id,
558 int cert_verify_flags,
559 const NetLogWithSource& net_log);
rtennetid073dd22016-08-04 01:58:33560
Zhongyi Shid04bd412019-08-26 23:31:08561 // Helper method to initialize the following migration options and check
562 // pre-requisites:
563 // - |params_.migrate_sessions_on_network_change_v2|
564 // - |params_.migrate_sessions_early_v2|
565 // - |params_.migrate_idle_sessions|
566 // - |params_.retry_on_alternate_network_before_handshake|
567 // If pre-requisites are not met, turn off the corresponding options.
568 void InitializeMigrationOptions();
569
[email protected]257f24f2014-04-01 09:15:37570 // Initializes the cached state associated with |server_id| in
rchf37ccc782016-01-31 05:13:50571 // |crypto_config_| with the information in |server_info|. Populates
572 // |connection_id| with the next server designated connection id,
573 // if any, and otherwise leaves it unchanged.
[email protected]60cf50e2014-04-28 23:23:18574 void InitializeCachedStateInCryptoConfig(
Ryan Hamilton8d9ee76e2018-05-29 23:52:52575 const quic::QuicServerId& server_id,
danakjad1777e2016-04-16 00:56:42576 const std::unique_ptr<QuicServerInfo>& server_info,
Ryan Hamilton8d9ee76e2018-05-29 23:52:52577 quic::QuicConnectionId* connection_id);
[email protected]b694e48c2014-03-18 17:10:13578
ckrasic4f9d88d2015-07-22 22:23:16579 void ProcessGoingAwaySession(QuicChromiumClientSession* session,
Ryan Hamilton8d9ee76e2018-05-29 23:52:52580 const quic::QuicServerId& server_id,
[email protected]eb71ab62014-05-23 07:57:53581 bool was_session_active);
[email protected]4d590c9c2014-05-02 05:14:33582
Matt Menkeb566c392019-09-11 23:22:43583 // Whether QUIC is known to work on current network. This is true when QUIC is
584 // expected to work in general, rather than whether QUIC was broken / recently
585 // broken when used with a particular server. That information is stored in
586 // the broken alternative service map in HttpServerProperties.
587 bool is_quic_known_to_work_on_current_network_;
588
jridf673d22016-06-02 22:06:33589 NetLog* net_log_;
[email protected]e13201d82012-12-12 05:00:32590 HostResolver* host_resolver_;
591 ClientSocketFactory* client_socket_factory_;
bnc525e175a2016-06-20 12:36:40592 HttpServerProperties* http_server_properties_;
zhongyiaf257542016-12-19 03:36:01593 ServerPushDelegate* push_delegate_;
[email protected]5db452202014-08-19 05:22:15594 TransportSecurityState* transport_security_state_;
rtenneti052774e2015-11-24 21:00:12595 CTVerifier* cert_transparency_verifier_;
[email protected]e8ff26842013-03-22 21:02:05596 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory_;
Ryan Hamilton8d9ee76e2018-05-29 23:52:52597 quic::QuicRandom* random_generator_; // Unowned.
598 quic::QuicClock* clock_; // Unowned.
Nick Harper72ade192019-07-17 03:30:42599 QuicParams params_;
rchf11cc0f2016-11-15 03:04:32600 QuicClockSkewDetector clock_skew_detector_;
[email protected]e13201d82012-12-12 05:00:32601
tbansalfdf5665b2015-09-21 22:46:40602 // Factory which is used to create socket performance watcher. A new watcher
603 // is created for every QUIC connection.
604 // |socket_performance_watcher_factory_| may be null.
tbansalc8a94ea2015-11-02 23:58:51605 SocketPerformanceWatcherFactory* socket_performance_watcher_factory_;
tbansalfdf5665b2015-09-21 22:46:40606
[email protected]2cfc6bb82013-10-27 03:40:44607 // The helper used for all connections.
danakjad1777e2016-04-16 00:56:42608 std::unique_ptr<QuicChromiumConnectionHelper> helper_;
[email protected]2cfc6bb82013-10-27 03:40:44609
rch16c74d1d2016-04-22 06:14:07610 // The alarm factory used for all connections.
Ryan Hamilton8d9ee76e2018-05-29 23:52:52611 std::unique_ptr<quic::QuicAlarmFactory> alarm_factory_;
rch16c74d1d2016-04-22 06:14:07612
[email protected]e13201d82012-12-12 05:00:32613 // Contains owning pointers to all sessions that currently exist.
[email protected]4d590c9c2014-05-02 05:14:33614 SessionIdMap all_sessions_;
[email protected]e13201d82012-12-12 05:00:32615 // Contains non-owning pointers to currently active session
616 // (not going away session, once they're implemented).
617 SessionMap active_sessions_;
[email protected]eed749f92013-12-23 18:57:38618 // Map from session to set of aliases that this session is known by.
[email protected]e13201d82012-12-12 05:00:32619 SessionAliasMap session_aliases_;
[email protected]eed749f92013-12-23 18:57:38620 // Map from IP address to sessions which are connected to this address.
621 IPAliasMap ip_aliases_;
jri94ddc3142016-08-26 01:32:43622 // Map from session to its original peer IP address.
623 SessionPeerIPMap session_peer_ip_;
[email protected]e13201d82012-12-12 05:00:32624
[email protected]d8e2abf82014-03-06 10:30:10625 // Origins which have gone away recently.
626 AliasSet gone_away_aliases_;
627
Ryan Hamilton8d9ee76e2018-05-29 23:52:52628 const quic::QuicConfig config_;
629 quic::QuicCryptoClientConfig crypto_config_;
[email protected]b064310782013-05-30 21:12:17630
[email protected]e13201d82012-12-12 05:00:32631 JobMap active_jobs_;
[email protected]e13201d82012-12-12 05:00:32632
Ryan Hamilton8d9ee76e2018-05-29 23:52:52633 // Map of quic::QuicServerId to owning CertVerifierJob.
rtennetid073dd22016-08-04 01:58:33634 CertVerifierJobMap active_cert_verifier_jobs_;
635
zhongyidd1439f62016-09-02 02:02:26636 // PING timeout for connections.
Ryan Hamilton8d9ee76e2018-05-29 23:52:52637 quic::QuicTime::Delta ping_timeout_;
638 quic::QuicTime::Delta reduced_ping_timeout_;
zhongyidd1439f62016-09-02 02:02:26639
Zhongyi Shie01f2db2019-02-22 19:53:23640 // Timeout for how long the wire can have no retransmittable packets.
641 quic::QuicTime::Delta retransmittable_on_wire_timeout_;
642
rtenneti1cd3b162015-09-29 02:58:28643 // If more than |yield_after_packets_| packets have been read or more than
644 // |yield_after_duration_| time has passed, then
rcha02807b42016-01-29 21:56:15645 // QuicChromiumPacketReader::StartReading() yields by doing a PostTask().
rtenneti1cd3b162015-09-29 02:58:28646 int yield_after_packets_;
Ryan Hamilton8d9ee76e2018-05-29 23:52:52647 quic::QuicTime::Delta yield_after_duration_;
rtenneti1cd3b162015-09-29 02:58:28648
Zhongyi Shi6db13462018-05-19 01:36:26649 // If |migrate_sessions_early_v2_| is true, tracks the current default
650 // network, and is updated OnNetworkMadeDefault.
651 // Otherwise, always set to NetworkChangeNotifier::kInvalidNetwork.
652 NetworkChangeNotifier::NetworkHandle default_network_;
653
rtennetifc47e0e2014-09-26 02:54:05654 // Local address of socket that was created in CreateSession.
655 IPEndPoint local_address_;
Zhongyi Shia0cef1082017-08-25 01:49:50656 // True if we need to check HttpServerProperties if QUIC was supported last
657 // time.
658 bool need_to_check_persisted_supports_quic_;
rtennetifc47e0e2014-09-26 02:54:05659
rtenneti041b2992015-02-23 23:03:28660 NetworkConnection network_connection_;
661
ckrasic3865ee0f2016-02-29 22:04:56662 int num_push_streams_created_;
663
Ryan Hamilton8d9ee76e2018-05-29 23:52:52664 quic::QuicClientPushPromiseIndex push_promise_index_;
jric533399b2016-01-29 07:36:01665
Zhongyi Shic16b4102019-02-12 00:37:40666 const base::TickClock* tick_clock_;
667
Zhongyi Shi8fff75b2017-11-19 21:36:36668 base::SequencedTaskRunner* task_runner_;
rtenneti38f5cd52014-10-28 20:28:28669
Ryan Sleevib8449e02018-07-15 04:31:07670 SSLConfigService* const ssl_config_service_;
nharper642ae4b2016-06-30 00:40:36671
Jeremy Romand54000b22019-07-08 18:40:16672 base::WeakPtrFactory<QuicStreamFactory> weak_factory_{this};
[email protected]1e960032013-12-20 19:00:20673
[email protected]e13201d82012-12-12 05:00:32674 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory);
675};
676
677} // namespace net
678
Ryan Hamiltona3ee93a72018-08-01 22:03:08679#endif // NET_QUIC_QUIC_STREAM_FACTORY_H_