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

Unified Diff: net/quic/quic_client_session.cc

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_client_session.cc
diff --git a/net/quic/quic_client_session.cc b/net/quic/quic_client_session.cc
index 0625f08077d30c5c7c62a77e5668a72b8ee1c2d6..ae0d38052fb63cc12f96b0f1be72126ed003e400 100644
--- a/net/quic/quic_client_session.cc
+++ b/net/quic/quic_client_session.cc
@@ -593,6 +593,12 @@ void QuicClientSession::OnClosedStream() {
}
void QuicClientSession::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) {
+ if (stream_factory_ && event == HANDSHAKE_CONFIRMED &&
+ (stream_factory_->OnBadPacketLoss(this, server_id_,
Ryan Hamilton 2015/03/24 03:43:00 This looks much cleaner now. I like it! I think I
ramant (doing other things) 2015/03/24 17:19:23 +1. Thanks very much for the suggestion (me culpa)
+ logger_->ReceivedPacketLossRate()))) {
+ return;
+ }
+
if (!callback_.is_null() &&
(!require_confirmation_ ||
event == HANDSHAKE_CONFIRMED || event == ENCRYPTION_REESTABLISHED)) {
@@ -768,9 +774,10 @@ void QuicClientSession::StartReading() {
packet_reader_.StartReading();
}
-void QuicClientSession::CloseSessionOnError(int error) {
+void QuicClientSession::CloseSessionOnError(int error,
+ QuicErrorCode quic_error) {
UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicSession.CloseSessionOnError", -error);
- CloseSessionOnErrorInner(error, QUIC_INTERNAL_ERROR);
+ CloseSessionOnErrorInner(error, quic_error);
NotifyFactoryOfSessionClosed();
}

Powered by Google App Engine
This is Rietveld 408576698