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

Side by Side Diff: net/quic/quic_stream_factory.h

Issue 1025573002: QUIC - disable QUIC if packet loss rate is bad for a connection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor comment fixes Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_QUIC_QUIC_STREAM_FACTORY_H_ 5 #ifndef NET_QUIC_QUIC_STREAM_FACTORY_H_
6 #define NET_QUIC_QUIC_STREAM_FACTORY_H_ 6 #define NET_QUIC_QUIC_STREAM_FACTORY_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 size_t max_packet_length, 101 size_t max_packet_length,
102 const std::string& user_agent_id, 102 const std::string& user_agent_id,
103 const QuicVersionVector& supported_versions, 103 const QuicVersionVector& supported_versions,
104 bool enable_port_selection, 104 bool enable_port_selection,
105 bool always_require_handshake_confirmation, 105 bool always_require_handshake_confirmation,
106 bool disable_connection_pooling, 106 bool disable_connection_pooling,
107 float load_server_info_timeout_srtt_multiplier, 107 float load_server_info_timeout_srtt_multiplier,
108 bool enable_connection_racing, 108 bool enable_connection_racing,
109 bool enable_non_blocking_io, 109 bool enable_non_blocking_io,
110 bool disable_disk_cache, 110 bool disable_disk_cache,
111 int number_of_lossy_handshakes,
112 int packet_loss_threshold,
111 int socket_receive_buffer_size, 113 int socket_receive_buffer_size,
112 const QuicTagVector& connection_options); 114 const QuicTagVector& connection_options);
113 ~QuicStreamFactory() override; 115 ~QuicStreamFactory() override;
114 116
115 // Creates a new QuicHttpStream to |host_port_pair| which will be 117 // Creates a new QuicHttpStream to |host_port_pair| which will be
116 // owned by |request|. |is_https| specifies if the protocol is https or not. 118 // owned by |request|. |is_https| specifies if the protocol is https or not.
117 // If a matching session already exists, this method will return OK. If no 119 // If a matching session already exists, this method will return OK. If no
118 // matching session exists, this will return ERR_IO_PENDING and will invoke 120 // matching session exists, this will return ERR_IO_PENDING and will invoke
119 // OnRequestComplete asynchronously. 121 // OnRequestComplete asynchronously.
120 int Create(const HostPortPair& host_port_pair, 122 int Create(const HostPortPair& host_port_pair,
121 bool is_https, 123 bool is_https,
122 PrivacyMode privacy_mode, 124 PrivacyMode privacy_mode,
123 base::StringPiece method, 125 base::StringPiece method,
124 const BoundNetLog& net_log, 126 const BoundNetLog& net_log,
125 QuicStreamRequest* request); 127 QuicStreamRequest* request);
126 128
129 // Called by a session when crypto handshake is either confirmed or timedout.
130 // Returns QUIC_NO_ERROR if there is no high packet loss. If there is a bad
131 // packet loss rate, marks QUIC as recently broken for the given |server_id|
132 // and returns QUIC_BAD_PACKET_LOSS_RATE.
133 QuicErrorCode OnCryptoHandshakeCompleted(QuicClientSession* session,
134 const QuicServerId& server_id,
135 int number_of_handshakes);
136
127 // Called by a session when it becomes idle. 137 // Called by a session when it becomes idle.
128 void OnIdleSession(QuicClientSession* session); 138 void OnIdleSession(QuicClientSession* session);
129 139
130 // Called by a session when it is going away and no more streams should be 140 // Called by a session when it is going away and no more streams should be
131 // created on it. 141 // created on it.
132 void OnSessionGoingAway(QuicClientSession* session); 142 void OnSessionGoingAway(QuicClientSession* session);
133 143
134 // Called by a session after it shuts down. 144 // Called by a session after it shuts down.
135 void OnSessionClosed(QuicClientSession* session); 145 void OnSessionClosed(QuicClientSession* session);
136 146
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 // INCHOATE_HELLO and another connection that sends CHLO after loading server 330 // INCHOATE_HELLO and another connection that sends CHLO after loading server
321 // config from the disk cache. 331 // config from the disk cache.
322 bool enable_connection_racing_; 332 bool enable_connection_racing_;
323 333
324 // Set if experimental non-blocking IO should be used on windows sockets. 334 // Set if experimental non-blocking IO should be used on windows sockets.
325 bool enable_non_blocking_io_; 335 bool enable_non_blocking_io_;
326 336
327 // Set if we do not want to load server config from the disk cache. 337 // Set if we do not want to load server config from the disk cache.
328 bool disable_disk_cache_; 338 bool disable_disk_cache_;
329 339
340 // Set if we want to disable QUIC for a connection if packet loss rate is bad.
341 int number_of_lossy_handshakes_;
Ryan Hamilton 2015/03/21 00:04:46 I wonder if this should be a count of "Connections
ramant (doing other things) 2015/03/21 03:46:05 Done.
342 int packet_loss_threshold_;
343
344 // Set if we do not want to use 0-RTT (not load server config from disk
345 // cache).
346 bool disable_zero_rtt_;
Ryan Hamilton 2015/03/21 00:04:46 As we discussed, I don't think we need this.
ramant (doing other things) 2015/03/21 03:46:05 Done.
347
330 // Size of the UDP receive buffer. 348 // Size of the UDP receive buffer.
331 int socket_receive_buffer_size_; 349 int socket_receive_buffer_size_;
332 350
333 // Each profile will (probably) have a unique port_seed_ value. This value 351 // Each profile will (probably) have a unique port_seed_ value. This value
334 // is used to help seed a pseudo-random number generator (PortSuggester) so 352 // is used to help seed a pseudo-random number generator (PortSuggester) so
335 // that we consistently (within this profile) suggest the same ephemeral 353 // that we consistently (within this profile) suggest the same ephemeral
336 // port when we re-connect to any given server/port. The differences between 354 // port when we re-connect to any given server/port. The differences between
337 // profiles (probablistically) prevent two profiles from colliding in their 355 // profiles (probablistically) prevent two profiles from colliding in their
338 // ephemeral port requests. 356 // ephemeral port requests.
339 uint64 port_seed_; 357 uint64 port_seed_;
340 358
341 // Local address of socket that was created in CreateSession. 359 // Local address of socket that was created in CreateSession.
342 IPEndPoint local_address_; 360 IPEndPoint local_address_;
343 bool check_persisted_supports_quic_; 361 bool check_persisted_supports_quic_;
344 std::set<HostPortPair> quic_supported_servers_at_startup_; 362 std::set<HostPortPair> quic_supported_servers_at_startup_;
345 363
346 NetworkConnection network_connection_; 364 NetworkConnection network_connection_;
347 365
348 base::TaskRunner* task_runner_; 366 base::TaskRunner* task_runner_;
349 367
350 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; 368 base::WeakPtrFactory<QuicStreamFactory> weak_factory_;
351 369
352 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); 370 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory);
353 }; 371 };
354 372
355 } // namespace net 373 } // namespace net
356 374
357 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ 375 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698