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

Unified Diff: net/nqe/network_quality_estimator.cc

Issue 2927453002: Make NQE a derived class of NetworkQualityProvider (Closed)
Patch Set: some more IWYU fixes Created 3 years, 6 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
« no previous file with comments | « net/nqe/network_quality_estimator.h ('k') | net/nqe/network_quality_estimator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « net/nqe/network_quality_estimator.h ('k') | net/nqe/network_quality_estimator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698