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

Unified Diff: net/quic/quic_stream_factory.h

Issue 1208933004: QUIC - disable QUIC under recent pathological connection errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: net-internals additions Created 5 years, 6 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 68b82d840f148bdda7020b254d3935382f0dbc10..36d6c73fadfb3b1b02d23c94ef84278aa2746a31 100644
--- a/net/quic/quic_stream_factory.h
+++ b/net/quic/quic_stream_factory.h
@@ -24,6 +24,7 @@
#include "net/quic/quic_crypto_stream.h"
#include "net/quic/quic_http_stream.h"
#include "net/quic/quic_protocol.h"
+#include "net/quic/quic_types.h"
namespace net {
@@ -121,6 +122,9 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
bool prefer_aes,
int max_number_of_lossy_connections,
float packet_loss_threshold,
+ int max_epitaphs,
+ int threshold_timeouts_with_streams_open,
+ int threshold_public_resets_post_handshake,
int socket_receive_buffer_size,
const QuicTagVector& connection_options);
~QuicStreamFactory() override;
@@ -151,6 +155,12 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
// Returns true if QUIC is disabled for this port.
bool IsQuicDisabled(uint16 port);
+ // Returns reason QUIC is disabled for this port, or QUIC_DISABLED_NOT if not.
+ QuicDisabledReason QuicDisabledReason(uint16 port);
+
+ // Returns reason QUIC is disabled as string for net-internals.
+ std::string QuicDisabledReasonString() const;
Ryan Hamilton 2015/07/06 18:25:41 nit: const std::string& ? (Or if that doesn't work
Buck 2015/07/06 21:39:32 going with const char* fyi, it is used in HttpNet
+
// Called by a session when it becomes idle.
void OnIdleSession(QuicClientSession* session);
@@ -244,6 +254,7 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
typedef std::map<QuicStreamRequest*, QuicServerId> RequestMap;
typedef std::set<QuicStreamRequest*> RequestSet;
typedef std::map<QuicServerId, RequestSet> ServerIDRequestsMap;
+ typedef std::deque<enum QuicDisabledReason> DisabledReasonsQueue;
// Creates a job which doesn't wait for server config to be loaded from the
// disk cache. This job is started via a PostTask.
@@ -291,6 +302,9 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
const QuicServerId& server_id,
bool was_session_active);
+ // Collect stats from epitaphs, possibly disabling Quic.
+ void MaybeDisableQuic(QuicClientSession* session);
+
bool require_confirmation_;
HostResolver* host_resolver_;
ClientSocketFactory* client_socket_factory_;
@@ -369,6 +383,21 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
// Count number of lossy connections by port.
std::map<uint16, int> number_of_lossy_connections_;
+ // Keep track of stats for recently closed connections, using a
+ // bounded queue.
+ int max_disabled_reasons_;
+ DisabledReasonsQueue disabled_reasons_;
+ // Events that can trigger disabling QUIC
+ int num_public_resets_post_handshake_;
+ int num_timeouts_with_open_streams_;
+ // Keep track the largest values for UMA histograms, that will help
+ // determine good threshold values.
+ int max_public_resets_post_handshake_;
+ int max_timeouts_with_open_streams_;
+ // Thresholds if greater than zero, determine when to
+ int threshold_timeouts_with_open_streams_;
+ int threshold_public_resets_post_handshake_;
+
// Size of the UDP receive buffer.
int socket_receive_buffer_size_;

Powered by Google App Engine
This is Rietveld 408576698