Index: net/quic/quic_stream_factory.h |
diff --git a/net/quic/quic_stream_factory.h b/net/quic/quic_stream_factory.h |
index c55059002be1edb4185c311b53eb601d59f0a3b4..fa9b835d23c6d5c0ec4fcadc647dc91bb2a74940 100644 |
--- a/net/quic/quic_stream_factory.h |
+++ b/net/quic/quic_stream_factory.h |
@@ -108,6 +108,8 @@ class NET_EXPORT_PRIVATE QuicStreamFactory |
bool enable_connection_racing, |
bool enable_non_blocking_io, |
bool disable_disk_cache, |
+ int max_number_of_lossy_connections, |
+ float packet_loss_threshold, |
int socket_receive_buffer_size, |
const QuicTagVector& connection_options); |
~QuicStreamFactory() override; |
@@ -124,6 +126,12 @@ class NET_EXPORT_PRIVATE QuicStreamFactory |
const BoundNetLog& net_log, |
QuicStreamRequest* request); |
+ // Keeps track of connections that had bad packet loss when handshake is |
+ // confirmed. Marks QUIC as recently broken for the given |server_id|. If the |
+ // total number of lossy connections is more than |
+ // max_number_of_lossy_connections_ then QUIC is disabled. |
+ void OnBadPacketLoss(const QuicServerId& server_id); |
+ |
// Called by a session when it becomes idle. |
void OnIdleSession(QuicClientSession* session); |
@@ -185,6 +193,10 @@ class NET_EXPORT_PRIVATE QuicStreamFactory |
enable_connection_racing_ = enable_connection_racing; |
} |
+ bool quic_is_disabled() const { return quic_is_disabled_; } |
Ryan Hamilton
2015/03/23 02:31:06
I think we need this per-port.
ramant (doing other things)
2015/03/24 03:07:22
Done.
|
+ |
+ float packet_loss_threshold() const { return packet_loss_threshold_; } |
+ |
private: |
class Job; |
friend class test::QuicStreamFactoryPeer; |
@@ -327,6 +339,13 @@ class NET_EXPORT_PRIVATE QuicStreamFactory |
// Set if we do not want to load server config from the disk cache. |
bool disable_disk_cache_; |
+ // Set if we want to disable QUIC when there is high packet loss rate. |
+ int max_number_of_lossy_connections_; |
+ int number_of_lossy_connections_; // Count of connections with high packet |
+ // loss. |
+ bool quic_is_disabled_; // Disabled in case of high packet loss. |
+ float packet_loss_threshold_; |
+ |
// Size of the UDP receive buffer. |
int socket_receive_buffer_size_; |