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

Unified Diff: net/nqe/network_quality_estimator.h

Issue 2103323007: Exposing NQE on the Browser UI thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mmenke comments Created 4 years, 5 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 | « chrome/chrome_tests.gypi ('k') | net/nqe/network_quality_estimator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/network_quality_estimator.h
diff --git a/net/nqe/network_quality_estimator.h b/net/nqe/network_quality_estimator.h
index afeca4eb01e1220879cb01bf87a644ebe06a9775..9be1e4414038e5fc3d1a6887d6b384a887010b45 100644
--- a/net/nqe/network_quality_estimator.h
+++ b/net/nqe/network_quality_estimator.h
@@ -45,21 +45,21 @@ class ThroughputAnalyzer;
class URLRequest;
// NetworkQualityEstimator provides network quality estimates (quality of the
// full paths to all origins that have been connected to).
// The estimates are based on the observed organic traffic.
// A NetworkQualityEstimator instance is attached to URLRequestContexts and
// observes the traffic of URLRequests spawned from the URLRequestContexts.
// A single instance of NQE can be attached to multiple URLRequestContexts,
// thereby increasing the single NQE instance's accuracy by providing more
// observed traffic characteristics.
-class NET_EXPORT_PRIVATE NetworkQualityEstimator
+class NET_EXPORT NetworkQualityEstimator
: public NetworkChangeNotifier::ConnectionTypeObserver,
public ExternalEstimateProvider::UpdatedEstimateDelegate {
public:
// EffectiveConnectionType is the connection type whose typical performance is
// most similar to the measured performance of the network in use. In many
// cases, the "effective" connection type and the actual type of connection in
// use are the same, but often a network connection performs significantly
// different, usually worse, from its expected capabilities.
// EffectiveConnectionType of a network is independent of if the current
// connection is metered or not. For example, an unmetered slow connection may
@@ -70,21 +70,21 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
EFFECTIVE_CONNECTION_TYPE_OFFLINE,
EFFECTIVE_CONNECTION_TYPE_SLOW_2G,
EFFECTIVE_CONNECTION_TYPE_2G,
EFFECTIVE_CONNECTION_TYPE_3G,
EFFECTIVE_CONNECTION_TYPE_4G,
EFFECTIVE_CONNECTION_TYPE_BROADBAND,
EFFECTIVE_CONNECTION_TYPE_LAST,
};
// Observes changes in effective connection type.
- class NET_EXPORT_PRIVATE EffectiveConnectionTypeObserver {
+ class NET_EXPORT EffectiveConnectionTypeObserver {
public:
// Notifies the observer of a change in the effective connection type.
// NetworkQualityEstimator computes the effective connection type once in
// every interval of duration
// |effective_connection_type_recomputation_interval_|. Additionally, when
// there is a change in the connection type of the device, then the
// effective connection type is immediately recomputed. The observer must
// register and unregister itself on the IO thread. All the observers would
// be notified on the IO thread.
//
@@ -230,20 +230,25 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
// |use_localhost_requests| should only be true when testing against local
// HTTP server and allows the requests to local host to be used for network
// quality estimation.
void SetUseLocalHostRequestsForTesting(bool use_localhost_requests);
// |use_smaller_responses_for_tests| should only be true when testing.
// Allows the responses smaller than |kMinTransferSizeInBits| to be used for
// network quality estimation.
void SetUseSmallResponsesForTesting(bool use_small_responses);
+ // Reports |effective_connection_type| to all
+ // EffectiveConnectionTypeObservers.
+ void ReportEffectiveConnectionTypeForTesting(
+ EffectiveConnectionType effective_connection_type);
+
protected:
// NetworkID is used to uniquely identify a network.
// For the purpose of network quality estimation and caching, a network is
// uniquely identified by a combination of |type| and
// |id|. This approach is unable to distinguish networks with
// same name (e.g., different Wi-Fi networks with same SSID).
// This is a protected member to expose it to tests.
struct NET_EXPORT_PRIVATE NetworkID {
NetworkID(NetworkChangeNotifier::ConnectionType type, const std::string& id)
: type(type), id(id) {}
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | net/nqe/network_quality_estimator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698