QUIC - disable QUIC if packet loss rate is bad for a connection.

Goal - Improve quality of service (QOS) in chromium when QUIC is
enabled. For some users when QUIC is enabled, their access to QUIC
based servers doesn't work well. This could be due to either high loss
rate while using UDP or service providers blacklisting ports 80/443 for
QUIC traffic.

+ One simple approach (which would detect breakage quickly) would be
  to look at the packet loss (received) when the crypto handshake
  is confirmed. When packet loss is "really bad", say over
  50% for 5 handshakes in a row, we will disable QUIC.

+ For a connection is packet loss is higher than the packet loss
  threshold, then we mark that port as recently broken. This would
  require crypto handshake confirmation.

+ Added two parameters - number of "lossy" connections (defaults to 0)
  and packet loss threshold (defaults to 1000%) params to determine
  when to disable QUIC. These parameters will be controlled by finch
  in the next CL.

[email protected], [email protected],[email protected]

Review URL: https://codereview.chromium.org/1025573002

Cr-Commit-Position: refs/heads/master@{#322630}
diff --git a/net/quic/quic_http_stream_test.cc b/net/quic/quic_http_stream_test.cc
index 497493c3..056208f1 100644
--- a/net/quic/quic_http_stream_test.cc
+++ b/net/quic/quic_http_stream_test.cc
@@ -145,7 +145,7 @@
   }
 
   ~QuicHttpStreamTest() {
-    session_->CloseSessionOnError(ERR_ABORTED);
+    session_->CloseSessionOnError(ERR_ABORTED, QUIC_INTERNAL_ERROR);
     for (size_t i = 0; i < writes_.size(); i++) {
       delete writes_[i].packet;
     }