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

Unified 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: disable QUIC by port 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 side-by-side diff with in-line comments
Download patch
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..1c310f287e8d5f231f192777be9c562a543f5657 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,18 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
const BoundNetLog& net_log,
QuicStreamRequest* request);
+ // Returns false if |packet_loss_rate| is less than |packet_loss_threshold_|
+ // otherwise it returns true and closes the session and marks QUIC as recently
+ // broken for the given |server_id|. Increments |number_of_lossy_connections_|
+ // for the server_id's port.
+ bool OnBadPacketLoss(QuicClientSession* session,
+ const QuicServerId& server_id,
Ryan Hamilton 2015/03/24 03:43:00 I think |session| has a server_id() method so perh
ramant (doing other things) 2015/03/24 17:19:24 Done.
+ float packet_loss_rate);
+
+ // Returns true if the |number_of_lossy_connections_| for the given port is
+ // greater than |max_number_of_lossy_connections_|.
Ryan Hamilton 2015/03/24 03:43:00 I think I would simply say // Returns true if QU
ramant (doing other things) 2015/03/24 17:19:23 Done.
+ bool IsQuicDisabled(uint16 port);
+
// Called by a session when it becomes idle.
void OnIdleSession(QuicClientSession* session);
@@ -327,6 +341,12 @@ 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_;
+ float packet_loss_threshold_;
+ // Count number of lossy connections by port.
+ std::map<uint16, int> number_of_lossy_connections_;
+
// Size of the UDP receive buffer.
int socket_receive_buffer_size_;

Powered by Google App Engine
This is Rietveld 408576698