Index: net/nqe/network_quality_estimator.cc |
diff --git a/net/nqe/network_quality_estimator.cc b/net/nqe/network_quality_estimator.cc |
index 8759b0fb4324cef241909f79fe3adf3fb2c12ec5..643a0efc92a39c0a86a3b782da548ff3b8d75269 100644 |
--- a/net/nqe/network_quality_estimator.cc |
+++ b/net/nqe/network_quality_estimator.cc |
@@ -1767,6 +1767,14 @@ void NetworkQualityEstimator::OnPrefsRead( |
} |
} |
+base::Optional<base::TimeDelta> NetworkQualityEstimator::GetHttpRTT() const { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ |
+ if (network_quality_.http_rtt() == nqe::internal::InvalidRTT()) |
+ return base::Optional<base::TimeDelta>(); |
+ return network_quality_.http_rtt(); |
+} |
+ |
base::Optional<base::TimeDelta> NetworkQualityEstimator::GetTransportRTT() |
const { |
DCHECK(thread_checker_.CalledOnValidThread()); |
@@ -1776,6 +1784,17 @@ base::Optional<base::TimeDelta> NetworkQualityEstimator::GetTransportRTT() |
return network_quality_.transport_rtt(); |
} |
+base::Optional<int32_t> NetworkQualityEstimator::GetDownstreamThroughputKbps() |
+ const { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ |
+ if (network_quality_.downstream_throughput_kbps() == |
+ nqe::internal::kInvalidThroughput) { |
+ return base::Optional<int32_t>(); |
+ } |
+ return network_quality_.downstream_throughput_kbps(); |
+} |
+ |
void NetworkQualityEstimator::MaybeUpdateNetworkQualityFromCache( |
const nqe::internal::NetworkID& network_id, |
const nqe::internal::CachedNetworkQuality& cached_network_quality) { |
@@ -1832,20 +1851,4 @@ const char* NetworkQualityEstimator::GetNameForStatistic(int i) const { |
return ""; |
} |
-base::Optional<base::TimeDelta> |
-NetworkQualityEstimator::NetworkQualityProvider::GetHttpRTT() const { |
- return base::Optional<base::TimeDelta>(); |
-} |
- |
-base::Optional<base::TimeDelta> |
-NetworkQualityEstimator::NetworkQualityProvider::GetTransportRTT() const { |
- return base::Optional<base::TimeDelta>(); |
-} |
- |
-base::Optional<int32_t> |
-NetworkQualityEstimator::NetworkQualityProvider::GetDownstreamThroughputKbps() |
- const { |
- return base::Optional<int32_t>(); |
-} |
- |
} // namespace net |