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

Unified Diff: net/nqe/network_quality_estimator.h

Issue 2491703003: NQE: Notify observer as soon as it is added (Closed)
Patch Set: ryansturm comments Created 4 years, 1 month 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 4368f41202283944447f07344b7dc6c1346801c0..9680d590e7a78161eaed5d8be593f250b5bb7ea5 100644
--- a/net/nqe/network_quality_estimator.h
+++ b/net/nqe/network_quality_estimator.h
@@ -214,7 +214,9 @@ class NET_EXPORT NetworkQualityEstimator
const base::TimeTicks& start_time) const;
// Adds |observer| to the list of effective connection type observers. Must be
- // called on the IO thread.
+ // called on the IO thread. |observer| would be notified of the current
+ // effective connection type in the next message pump, if it is still
+ // registered as an observer.
void AddEffectiveConnectionTypeObserver(
EffectiveConnectionTypeObserver* observer);
@@ -224,7 +226,9 @@ class NET_EXPORT NetworkQualityEstimator
EffectiveConnectionTypeObserver* observer);
// Adds |observer| to the list of RTT and throughput estimate observers. Must
- // be called on the IO thread.
+ // be called on the IO thread. |observer| would be notified of the current RTT
+ // and throughput estimates in the next message pump, if it is still
+ // registered as an observer.
void AddRTTAndThroughputEstimatesObserver(
RTTAndThroughputEstimatesObserver* observer);
@@ -492,6 +496,16 @@ class NET_EXPORT NetworkQualityEstimator
// Notifies the observers of RTT or throughput estimates computation.
void NotifyObserversOfRTTOrThroughputComputed() const;
+ // Notifies |observer| of the current effective connection type if |observer|
+ // is still registered as an observer.
+ void NotifyEffectiveConnectionTypeObserverIfPresent(
+ EffectiveConnectionTypeObserver* observer) const;
+
+ // Notifies |observer| of the current RTT and throughput if |observer| is
+ // still registered as an observer.
+ void NotifyRTTAndThroughputEstimatesObserverIfPresent(
+ RTTAndThroughputEstimatesObserver* observer) const;
+
// Records NQE accuracy metrics. |measuring_duration| should belong to the
// vector returned by AccuracyRecordingIntervals().
// RecordAccuracyAfterMainFrame should be called |measuring_duration| after a

Powered by Google App Engine
This is Rietveld 408576698