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

Unified Diff: net/nqe/network_quality_estimator.h

Issue 2717153002: NQE: Plumb RTT and throughput estimates to the UI thread (Closed)
Patch Set: ryansturm comments Created 3 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/nqe/network_quality_estimator.h
diff --git a/net/nqe/network_quality_estimator.h b/net/nqe/network_quality_estimator.h
index 696e9b0e85d39c0e2095b90a48dc00a083f8efb2..6305605a5eeff398a201124d0d5aefa6d5cc72bc 100644
--- a/net/nqe/network_quality_estimator.h
+++ b/net/nqe/network_quality_estimator.h
@@ -160,6 +160,8 @@ class NET_EXPORT NetworkQualityEstimator
// Returns the current effective connection type.
virtual EffectiveConnectionType GetEffectiveConnectionType() const = 0;
+ virtual ~NetworkQualityProvider() {}
+
// Adds |observer| to a list of effective connection type observers.
virtual void AddEffectiveConnectionTypeObserver(
EffectiveConnectionTypeObserver* observer) = 0;
@@ -168,7 +170,16 @@ class NET_EXPORT NetworkQualityEstimator
virtual void RemoveEffectiveConnectionTypeObserver(
EffectiveConnectionTypeObserver* observer) = 0;
- virtual ~NetworkQualityProvider() {}
+ // Adds |observer| to the list of RTT and throughput estimate observers.
+ // |observer| would be notified of the current RTT and throughput estimates
+ // in the next message pump.
+ void AddRTTAndThroughputEstimatesObserver(
RyanSturm 2017/03/10 22:10:47 virtual
+ RTTAndThroughputEstimatesObserver* observer) override;
+
+ // Removes |observer| from the list of RTT and throughput estimate
+ // observers.
+ void RemoveRTTAndThroughputEstimatesObserver(
RyanSturm 2017/03/10 22:10:47 virtual
+ RTTAndThroughputEstimatesObserver* observer) override;
protected:
NetworkQualityProvider() {}
@@ -296,6 +307,11 @@ class NET_EXPORT NetworkQualityEstimator
void ReportEffectiveConnectionTypeForTesting(
EffectiveConnectionType effective_connection_type);
+ // Reports the RTTs and throughput to all RTTAndThroughputEstimatesObservers.
+ void ReportRTTsAndThroughputForTesting(base::TimeDelta http_rtt,
+ base::TimeDelta transport_rtt,
+ int32_t downstream_throughput_kbps);
+
// Adds and removes |observer| from the list of cache observers.
void AddNetworkQualitiesCacheObserver(
nqe::internal::NetworkQualityStore::NetworkQualitiesCacheObserver*

Powered by Google App Engine
This is Rietveld 408576698