Throughput: Change the min number of requests in flight required

In network quality estimator (NQE), change the minimum number of
requests in flight required before a throughput observation can be
taken. The parameter is controlled using field trial params, with
default value set to 1.

BUG=725146

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_cronet_tester

Review-Url: https://codereview.chromium.org/2893933004
Cr-Commit-Position: refs/heads/master@{#473755}
diff --git a/net/nqe/throughput_analyzer.h b/net/nqe/throughput_analyzer.h
index e94102b..d83e9db 100644
--- a/net/nqe/throughput_analyzer.h
+++ b/net/nqe/throughput_analyzer.h
@@ -31,6 +31,8 @@
 
 namespace internal {
 
+class NetworkQualityEstimatorParams;
+
 // Makes throughput observations. Polls NetworkActivityMonitor
 // (TrafficStats on Android) to count number of bits received over throughput
 // observation windows in accordance with the following rules:
@@ -55,6 +57,7 @@
   // estimation.
   // Virtualized for testing.
   ThroughputAnalyzer(
+      const NetworkQualityEstimatorParams* params,
       scoped_refptr<base::SingleThreadTaskRunner> task_runner,
       ThroughputObservationCallback throughput_observation_callback,
       bool use_local_host_requests_for_tests,
@@ -106,7 +109,7 @@
   // tracking throughput. A throughput observation can be taken only if the
   // time-window is currently active, and enough bytes have accumulated in
   // that window. |downstream_kbps| should not be null.
-  bool MayBeGetThroughputObservation(int32_t* downstream_kbps);
+  bool MaybeGetThroughputObservation(int32_t* downstream_kbps);
 
   // Starts the throughput observation window that keeps track of network
   // bytes if the following conditions are true:
@@ -133,6 +136,7 @@
   // do not exceed their capacities.
   void BoundRequestsSize();
 
+  const NetworkQualityEstimatorParams* params_;
   scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
 
   // Called every time a new throughput observation is available.