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

Unified Diff: net/quic/quic_client_session.h

Issue 1208933004: QUIC - disable QUIC under recent pathological connection errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move dead code out of OnHandshakeConfirmed to where it will actually work (spotted by Ryan). Created 5 years, 5 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_client_session.h
diff --git a/net/quic/quic_client_session.h b/net/quic/quic_client_session.h
index 414b9069b105cbdfdbbf5f2927d9857475d2f1f1..7a1fe7c742fc5310352041e41f64358433bd5204 100644
--- a/net/quic/quic_client_session.h
+++ b/net/quic/quic_client_session.h
@@ -44,6 +44,18 @@ class QuicClientSessionPeer;
class NET_EXPORT_PRIVATE QuicClientSession : public QuicClientSessionBase,
public QuicPacketReader::Visitor {
public:
+ // Reasons we may disable QUIC, that is under certain pathological
Ryan Hamilton 2015/07/07 03:09:37 nit: Please don't use the first person in comments
Buck 2015/07/07 18:38:48 Done.
+ // connection errors. Note: these values must be kept in sync with
+ // the corresponding values of QuicDisabledReason in:
+ // tools/metrics/histograms/histograms.xml
+ enum QuicDisabledReason {
+ QUIC_DISABLED_NOT = 0, // default, not disabled
+ QUIC_DISABLED_PUBLIC_RESET_POST_HANDSHAKE = 1,
+ QUIC_DISABLED_TIMEOUT_WITH_OPEN_STREAMS = 2,
+ QUIC_DISABLED_BAD_PACKET_LOSS_RATE = 3,
+ QUIC_DISABLED_MAX = 4,
+ };
+
// An interface for observing events on a session.
class NET_EXPORT_PRIVATE Observer {
public:
@@ -194,6 +206,8 @@ class NET_EXPORT_PRIVATE QuicClientSession : public QuicClientSessionBase,
const QuicServerId& server_id() const { return server_id_; }
+ const QuicDisabledReason disabled_reason() const { return disabled_reason_; }
Alexei Svitkine (slow) 2015/07/07 15:15:29 Nit: No need for leading const.
Buck 2015/07/07 18:38:48 Done.
+
protected:
// QuicSession methods:
QuicDataStream* CreateIncomingDynamicStream(QuicStreamId id) override;
@@ -261,6 +275,7 @@ class NET_EXPORT_PRIVATE QuicClientSession : public QuicClientSessionBase,
// True when the session is going away, and streams may no longer be created
// on this session. Existing stream will continue to be processed.
bool going_away_;
+ QuicDisabledReason disabled_reason_;
base::WeakPtrFactory<QuicClientSession> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(QuicClientSession);

Powered by Google App Engine
This is Rietveld 408576698