Commit ed2b20b6 authored by Tarun Bansal's avatar Tarun Bansal Committed by Commit Bot

Network Quality Estimator: Remove Network Quality Provider class

Network Quality Provider is the base class for network quality
estimator (NQE). It was originally added as a read-only version
of NQE with the goal of passing it to
consumers outside of //net, and preventing them
from calling internal net-specific APIs. With servicification, this is
no longer needed.

In short term, it also makes it simpler to plumb NQE to
H2 session class (see linked bug) which will be done
in a subsequent CL.

This is purely a refactor CL, and does not introduce any
functionality change.

Change-Id: Ibb5bbf6a06ca02d232fbca0c29022422738694f4
Bug: 823322
Reviewed-on: https://chromium-review.googlesource.com/c/1280860Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
Reviewed-by: default avatarRyan Sturm <ryansturm@chromium.org>
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599721}
parent 7fc2bace
...@@ -868,8 +868,6 @@ component("net") { ...@@ -868,8 +868,6 @@ component("net") {
"nqe/network_quality_observation.h", "nqe/network_quality_observation.h",
"nqe/network_quality_observation_source.cc", "nqe/network_quality_observation_source.cc",
"nqe/network_quality_observation_source.h", "nqe/network_quality_observation_source.h",
"nqe/network_quality_provider.cc",
"nqe/network_quality_provider.h",
"nqe/network_quality_store.cc", "nqe/network_quality_store.cc",
"nqe/network_quality_store.h", "nqe/network_quality_store.h",
"nqe/observation_buffer.cc", "nqe/observation_buffer.cc",
......
...@@ -56,7 +56,7 @@ std::unique_ptr<ClientSocketPoolManager> CreateSocketPoolManager( ...@@ -56,7 +56,7 @@ std::unique_ptr<ClientSocketPoolManager> CreateSocketPoolManager(
context.client_socket_factory ? context.client_socket_factory context.client_socket_factory ? context.client_socket_factory
: ClientSocketFactory::GetDefaultFactory(), : ClientSocketFactory::GetDefaultFactory(),
context.socket_performance_watcher_factory, context.socket_performance_watcher_factory,
context.network_quality_provider, context.host_resolver, context.network_quality_estimator, context.host_resolver,
context.cert_verifier, context.channel_id_service, context.cert_verifier, context.channel_id_service,
context.transport_security_state, context.cert_transparency_verifier, context.transport_security_state, context.cert_transparency_verifier,
context.ct_policy_enforcer, ssl_session_cache_shard, context.ct_policy_enforcer, ssl_session_cache_shard,
...@@ -165,7 +165,7 @@ HttpNetworkSession::Context::Context() ...@@ -165,7 +165,7 @@ HttpNetworkSession::Context::Context()
http_auth_handler_factory(nullptr), http_auth_handler_factory(nullptr),
net_log(nullptr), net_log(nullptr),
socket_performance_watcher_factory(nullptr), socket_performance_watcher_factory(nullptr),
network_quality_provider(nullptr), network_quality_estimator(nullptr),
quic_clock(nullptr), quic_clock(nullptr),
quic_random(nullptr), quic_random(nullptr),
quic_crypto_client_stream_factory( quic_crypto_client_stream_factory(
......
...@@ -56,7 +56,7 @@ class HttpProxyClientSocketPool; ...@@ -56,7 +56,7 @@ class HttpProxyClientSocketPool;
class HttpResponseBodyDrainer; class HttpResponseBodyDrainer;
class HttpServerProperties; class HttpServerProperties;
class NetLog; class NetLog;
class NetworkQualityProvider; class NetworkQualityEstimator;
class ProxyResolutionService; class ProxyResolutionService;
} // namespace net } // namespace net
namespace quic { namespace quic {
...@@ -257,7 +257,7 @@ class NET_EXPORT HttpNetworkSession { ...@@ -257,7 +257,7 @@ class NET_EXPORT HttpNetworkSession {
HttpServerProperties* http_server_properties; HttpServerProperties* http_server_properties;
NetLog* net_log; NetLog* net_log;
SocketPerformanceWatcherFactory* socket_performance_watcher_factory; SocketPerformanceWatcherFactory* socket_performance_watcher_factory;
NetworkQualityProvider* network_quality_provider; NetworkQualityEstimator* network_quality_estimator;
// Source of time for QUIC connections. // Source of time for QUIC connections.
quic::QuicClock* quic_clock; quic::QuicClock* quic_clock;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "net/http/http_proxy_client_socket_wrapper.h" #include "net/http/http_proxy_client_socket_wrapper.h"
#include "net/log/net_log_source_type.h" #include "net/log/net_log_source_type.h"
#include "net/log/net_log_with_source.h" #include "net/log/net_log_with_source.h"
#include "net/nqe/network_quality_provider.h" #include "net/nqe/network_quality_estimator.h"
#include "net/socket/client_socket_factory.h" #include "net/socket/client_socket_factory.h"
#include "net/socket/client_socket_handle.h" #include "net/socket/client_socket_handle.h"
#include "net/socket/client_socket_pool_base.h" #include "net/socket/client_socket_pool_base.h"
...@@ -193,13 +193,14 @@ int HttpProxyConnectJob::HandleConnectResult(int result) { ...@@ -193,13 +193,14 @@ int HttpProxyConnectJob::HandleConnectResult(int result) {
} }
HttpProxyClientSocketPool::HttpProxyConnectJobFactory:: HttpProxyClientSocketPool::HttpProxyConnectJobFactory::
HttpProxyConnectJobFactory(TransportClientSocketPool* transport_pool, HttpProxyConnectJobFactory(
SSLClientSocketPool* ssl_pool, TransportClientSocketPool* transport_pool,
NetworkQualityProvider* network_quality_provider, SSLClientSocketPool* ssl_pool,
NetLog* net_log) NetworkQualityEstimator* network_quality_estimator,
NetLog* net_log)
: transport_pool_(transport_pool), : transport_pool_(transport_pool),
ssl_pool_(ssl_pool), ssl_pool_(ssl_pool),
network_quality_provider_(network_quality_provider), network_quality_estimator_(network_quality_estimator),
ssl_http_rtt_multiplier_(GetInt32Param("ssl_http_rtt_multiplier", 10)), ssl_http_rtt_multiplier_(GetInt32Param("ssl_http_rtt_multiplier", 10)),
non_ssl_http_rtt_multiplier_( non_ssl_http_rtt_multiplier_(
GetInt32Param("non_ssl_http_rtt_multiplier", 5)), GetInt32Param("non_ssl_http_rtt_multiplier", 5)),
...@@ -247,9 +248,9 @@ HttpProxyClientSocketPool::HttpProxyConnectJobFactory::ConnectionTimeout() ...@@ -247,9 +248,9 @@ HttpProxyClientSocketPool::HttpProxyConnectJobFactory::ConnectionTimeout()
base::TimeDelta HttpProxyClientSocketPool::HttpProxyConnectJobFactory:: base::TimeDelta HttpProxyClientSocketPool::HttpProxyConnectJobFactory::
ConnectionTimeoutWithConnectionProperty(bool is_secure_connection) const { ConnectionTimeoutWithConnectionProperty(bool is_secure_connection) const {
if (network_quality_provider_) { if (network_quality_estimator_) {
base::Optional<base::TimeDelta> http_rtt_estimate = base::Optional<base::TimeDelta> http_rtt_estimate =
network_quality_provider_->GetHttpRTT(); network_quality_estimator_->GetHttpRTT();
if (http_rtt_estimate) { if (http_rtt_estimate) {
int32_t multiplier = is_secure_connection ? ssl_http_rtt_multiplier_ int32_t multiplier = is_secure_connection ? ssl_http_rtt_multiplier_
: non_ssl_http_rtt_multiplier_; : non_ssl_http_rtt_multiplier_;
...@@ -285,7 +286,7 @@ HttpProxyClientSocketPool::HttpProxyClientSocketPool( ...@@ -285,7 +286,7 @@ HttpProxyClientSocketPool::HttpProxyClientSocketPool(
int max_sockets_per_group, int max_sockets_per_group,
TransportClientSocketPool* transport_pool, TransportClientSocketPool* transport_pool,
SSLClientSocketPool* ssl_pool, SSLClientSocketPool* ssl_pool,
NetworkQualityProvider* network_quality_provider, NetworkQualityEstimator* network_quality_estimator,
NetLog* net_log) NetLog* net_log)
: transport_pool_(transport_pool), : transport_pool_(transport_pool),
ssl_pool_(ssl_pool), ssl_pool_(ssl_pool),
...@@ -296,7 +297,7 @@ HttpProxyClientSocketPool::HttpProxyClientSocketPool( ...@@ -296,7 +297,7 @@ HttpProxyClientSocketPool::HttpProxyClientSocketPool(
ClientSocketPool::used_idle_socket_timeout(), ClientSocketPool::used_idle_socket_timeout(),
new HttpProxyConnectJobFactory(transport_pool, new HttpProxyConnectJobFactory(transport_pool,
ssl_pool, ssl_pool,
network_quality_provider, network_quality_estimator,
net_log)) { net_log)) {
// We should always have a |transport_pool_| except in unit tests. // We should always have a |transport_pool_| except in unit tests.
if (transport_pool_) if (transport_pool_)
......
...@@ -32,7 +32,7 @@ class HttpAuthCache; ...@@ -32,7 +32,7 @@ class HttpAuthCache;
class HttpAuthHandlerFactory; class HttpAuthHandlerFactory;
class HttpProxyClientSocketWrapper; class HttpProxyClientSocketWrapper;
class NetLog; class NetLog;
class NetworkQualityProvider; class NetworkQualityEstimator;
class QuicStreamFactory; class QuicStreamFactory;
class SSLClientSocketPool; class SSLClientSocketPool;
class SSLSocketParams; class SSLSocketParams;
...@@ -160,7 +160,7 @@ class NET_EXPORT_PRIVATE HttpProxyClientSocketPool ...@@ -160,7 +160,7 @@ class NET_EXPORT_PRIVATE HttpProxyClientSocketPool
int max_sockets_per_group, int max_sockets_per_group,
TransportClientSocketPool* transport_pool, TransportClientSocketPool* transport_pool,
SSLClientSocketPool* ssl_pool, SSLClientSocketPool* ssl_pool,
NetworkQualityProvider* network_quality_provider, NetworkQualityEstimator* network_quality_estimator,
NetLog* net_log); NetLog* net_log);
~HttpProxyClientSocketPool() override; ~HttpProxyClientSocketPool() override;
...@@ -230,10 +230,11 @@ class NET_EXPORT_PRIVATE HttpProxyClientSocketPool ...@@ -230,10 +230,11 @@ class NET_EXPORT_PRIVATE HttpProxyClientSocketPool
class NET_EXPORT_PRIVATE HttpProxyConnectJobFactory class NET_EXPORT_PRIVATE HttpProxyConnectJobFactory
: public PoolBase::ConnectJobFactory { : public PoolBase::ConnectJobFactory {
public: public:
HttpProxyConnectJobFactory(TransportClientSocketPool* transport_pool, HttpProxyConnectJobFactory(
SSLClientSocketPool* ssl_pool, TransportClientSocketPool* transport_pool,
NetworkQualityProvider* network_quality_provider, SSLClientSocketPool* ssl_pool,
NetLog* net_log); NetworkQualityEstimator* network_quality_estimator,
NetLog* net_log);
// ClientSocketPoolBase::ConnectJobFactory methods. // ClientSocketPoolBase::ConnectJobFactory methods.
std::unique_ptr<ConnectJob> NewConnectJob( std::unique_ptr<ConnectJob> NewConnectJob(
...@@ -255,7 +256,7 @@ class NET_EXPORT_PRIVATE HttpProxyClientSocketPool ...@@ -255,7 +256,7 @@ class NET_EXPORT_PRIVATE HttpProxyClientSocketPool
TransportClientSocketPool* const transport_pool_; TransportClientSocketPool* const transport_pool_;
SSLClientSocketPool* const ssl_pool_; SSLClientSocketPool* const ssl_pool_;
NetworkQualityProvider* const network_quality_provider_; NetworkQualityEstimator* const network_quality_estimator_;
// For secure proxies, the connection timeout is set to // For secure proxies, the connection timeout is set to
// |ssl_http_rtt_multiplier_| times the HTTP RTT estimate. For insecure // |ssl_http_rtt_multiplier_| times the HTTP RTT estimate. For insecure
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "net/nqe/network_quality_estimator_params.h" #include "net/nqe/network_quality_estimator_params.h"
#include "net/nqe/network_quality_observation.h" #include "net/nqe/network_quality_observation.h"
#include "net/nqe/network_quality_observation_source.h" #include "net/nqe/network_quality_observation_source.h"
#include "net/nqe/network_quality_provider.h"
#include "net/nqe/network_quality_store.h" #include "net/nqe/network_quality_store.h"
#include "net/nqe/observation_buffer.h" #include "net/nqe/observation_buffer.h"
#include "net/nqe/rtt_throughput_estimates_observer.h" #include "net/nqe/rtt_throughput_estimates_observer.h"
...@@ -65,8 +64,7 @@ class URLRequest; ...@@ -65,8 +64,7 @@ class URLRequest;
// thereby increasing the single NQE instance's accuracy by providing more // thereby increasing the single NQE instance's accuracy by providing more
// observed traffic characteristics. // observed traffic characteristics.
class NET_EXPORT NetworkQualityEstimator class NET_EXPORT NetworkQualityEstimator
: public NetworkChangeNotifier::ConnectionTypeObserver, : public NetworkChangeNotifier::ConnectionTypeObserver {
public NetworkQualityProvider {
public: public:
// Observes measurements of round trip time. // Observes measurements of round trip time.
class NET_EXPORT_PRIVATE RTTObserver { class NET_EXPORT_PRIVATE RTTObserver {
...@@ -120,17 +118,46 @@ class NET_EXPORT NetworkQualityEstimator ...@@ -120,17 +118,46 @@ class NET_EXPORT NetworkQualityEstimator
virtual EffectiveConnectionType GetRecentEffectiveConnectionType( virtual EffectiveConnectionType GetRecentEffectiveConnectionType(
const base::TimeTicks& start_time) const; const base::TimeTicks& start_time) const;
// NetworkQualityProvider implementation: // Returns the current effective connection type. The effective connection
// Must be called on the IO thread. // type is computed by the network quality estimator at regular intervals and
EffectiveConnectionType GetEffectiveConnectionType() const override; // at certain events (e.g., connection change). Virtualized for testing.
virtual EffectiveConnectionType GetEffectiveConnectionType() const;
// Adds |observer| to a list of effective connection type observers.
// The observer must register and unregister itself on the same thread.
// |observer| would be notified on the thread on which it registered.
// |observer| would be notified of the current effective connection
// type in the next message pump.
void AddEffectiveConnectionTypeObserver( void AddEffectiveConnectionTypeObserver(
EffectiveConnectionTypeObserver* observer) override; EffectiveConnectionTypeObserver* observer);
// Removes |observer| from a list of effective connection type observers.
void RemoveEffectiveConnectionTypeObserver( void RemoveEffectiveConnectionTypeObserver(
EffectiveConnectionTypeObserver* observer) override; EffectiveConnectionTypeObserver* observer);
base::Optional<base::TimeDelta> GetHttpRTT() const override;
base::Optional<base::TimeDelta> GetTransportRTT() const override; // Returns the current HTTP RTT estimate. If the estimate is unavailable,
base::Optional<int32_t> GetDownstreamThroughputKbps() const override; // the returned optional value is null. The RTT at the HTTP layer measures the
base::Optional<int32_t> GetBandwidthDelayProductKbits() const override; // time from when the request was sent (this happens after the connection is
// established) to the time when the response headers were received.
// Virtualized for testing.
virtual base::Optional<base::TimeDelta> GetHttpRTT() const;
// Returns the current transport RTT estimate. If the estimate is
// unavailable, the returned optional value is null. The RTT at the transport
// layer provides an aggregate estimate of the transport RTT as computed by
// various underlying TCP and QUIC connections. Virtualized for testing.
virtual base::Optional<base::TimeDelta> GetTransportRTT() const;
// Returns the current downstream throughput estimate (in kilobits per
// second). If the estimate is unavailable, the returned optional value is
// null.
base::Optional<int32_t> GetDownstreamThroughputKbps() const;
// Returns the current bandwidth delay product estimate (in kilobits). If the
// estimate is not available, the returned optional value is null. The
// bandwidth delay product is calculated from the transport RTT and the
// downlink bandwidth estimates. Virtualized for testing.
virtual base::Optional<int32_t> GetBandwidthDelayProductKbits() const;
// Adds |observer| to the list of RTT and throughput estimate observers. // Adds |observer| to the list of RTT and throughput estimate observers.
// The observer must register and unregister itself on the same thread. // The observer must register and unregister itself on the same thread.
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/nqe/network_quality_provider.h"
namespace net {
EffectiveConnectionType NetworkQualityProvider::GetEffectiveConnectionType()
const {
return EFFECTIVE_CONNECTION_TYPE_UNKNOWN;
}
base::Optional<base::TimeDelta> NetworkQualityProvider::GetHttpRTT() const {
return base::Optional<base::TimeDelta>();
}
base::Optional<base::TimeDelta> NetworkQualityProvider::GetTransportRTT()
const {
return base::Optional<base::TimeDelta>();
}
base::Optional<int32_t> NetworkQualityProvider::GetDownstreamThroughputKbps()
const {
return base::Optional<int32_t>();
}
base::Optional<int32_t> NetworkQualityProvider::GetBandwidthDelayProductKbits()
const {
return base ::Optional<int32_t>();
}
} // namespace net
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_NQE_NETWORK_QUALITY_PROVIDER_H_
#define NET_NQE_NETWORK_QUALITY_PROVIDER_H_
#include <stdint.h>
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/optional.h"
#include "base/time/time.h"
#include "net/base/net_export.h"
#include "net/nqe/effective_connection_type.h"
namespace net {
class EffectiveConnectionTypeObserver;
// Provides simple interface to obtain the network quality, and to listen to
// the changes in the network quality.
class NET_EXPORT NetworkQualityProvider {
public:
virtual ~NetworkQualityProvider() {}
// Returns the current effective connection type. The effective connection
// type is computed by the network quality estimator at regular intervals and
// at certain events (e.g., connection change).
virtual EffectiveConnectionType GetEffectiveConnectionType() const;
// Adds |observer| to a list of effective connection type observers.
// The observer must register and unregister itself on the same thread.
// |observer| would be notified on the thread on which it registered.
// |observer| would be notified of the current effective connection
// type in the next message pump.
virtual void AddEffectiveConnectionTypeObserver(
EffectiveConnectionTypeObserver* observer) {}
// Removes |observer| from a list of effective connection type observers.
virtual void RemoveEffectiveConnectionTypeObserver(
EffectiveConnectionTypeObserver* observer) {}
// Returns the current HTTP RTT estimate. If the estimate is unavailable,
// the returned optional value is null. The RTT at the HTTP layer measures the
// time from when the request was sent (this happens after the connection is
// established) to the time when the response headers were received.
virtual base::Optional<base::TimeDelta> GetHttpRTT() const;
// Returns the current transport RTT estimate. If the estimate is
// unavailable, the returned optional value is null. The RTT at the transport
// layer provides an aggregate estimate of the transport RTT as computed by
// various underlying TCP and QUIC connections.
virtual base::Optional<base::TimeDelta> GetTransportRTT() const;
// Returns the current downstream throughput estimate (in kilobits per
// second). If the estimate is unavailable, the returned optional value is
// null.
virtual base::Optional<int32_t> GetDownstreamThroughputKbps() const;
// Returns the current bandwidth delay product estimate (in kilobits). If the
// estimate is not available, the returned optional value is null. The
// bandwidth delay product is calculated from the transport RTT and the
// downlink bandwidth estimates.
virtual base::Optional<int32_t> GetBandwidthDelayProductKbits() const;
protected:
NetworkQualityProvider() {}
private:
DISALLOW_COPY_AND_ASSIGN(NetworkQualityProvider);
};
} // namespace net
#endif // NET_NQE_NETWORK_QUALITY_PROVIDER_H_
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
#include "net/base/host_port_pair.h" #include "net/base/host_port_pair.h"
#include "net/base/network_activity_monitor.h" #include "net/base/network_activity_monitor.h"
#include "net/base/url_util.h" #include "net/base/url_util.h"
#include "net/nqe/network_quality_estimator.h"
#include "net/nqe/network_quality_estimator_params.h" #include "net/nqe/network_quality_estimator_params.h"
#include "net/nqe/network_quality_estimator_util.h" #include "net/nqe/network_quality_estimator_util.h"
#include "net/nqe/network_quality_provider.h"
#include "net/url_request/url_request.h" #include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context.h"
...@@ -42,13 +42,13 @@ namespace nqe { ...@@ -42,13 +42,13 @@ namespace nqe {
namespace internal { namespace internal {
ThroughputAnalyzer::ThroughputAnalyzer( ThroughputAnalyzer::ThroughputAnalyzer(
const NetworkQualityProvider* network_quality_provider, const NetworkQualityEstimator* network_quality_estimator,
const NetworkQualityEstimatorParams* params, const NetworkQualityEstimatorParams* params,
scoped_refptr<base::SingleThreadTaskRunner> task_runner, scoped_refptr<base::SingleThreadTaskRunner> task_runner,
ThroughputObservationCallback throughput_observation_callback, ThroughputObservationCallback throughput_observation_callback,
const base::TickClock* tick_clock, const base::TickClock* tick_clock,
const NetLogWithSource& net_log) const NetLogWithSource& net_log)
: network_quality_provider_(network_quality_provider), : network_quality_estimator_(network_quality_estimator),
params_(params), params_(params),
task_runner_(task_runner), task_runner_(task_runner),
throughput_observation_callback_(throughput_observation_callback), throughput_observation_callback_(throughput_observation_callback),
...@@ -60,7 +60,7 @@ ThroughputAnalyzer::ThroughputAnalyzer( ...@@ -60,7 +60,7 @@ ThroughputAnalyzer::ThroughputAnalyzer(
use_localhost_requests_for_tests_(false), use_localhost_requests_for_tests_(false),
net_log_(net_log) { net_log_(net_log) {
DCHECK(tick_clock_); DCHECK(tick_clock_);
DCHECK(network_quality_provider_); DCHECK(network_quality_estimator_);
DCHECK(params_); DCHECK(params_);
DCHECK(task_runner_); DCHECK(task_runner_);
DCHECK(!IsCurrentlyTrackingThroughput()); DCHECK(!IsCurrentlyTrackingThroughput());
...@@ -234,7 +234,7 @@ bool ThroughputAnalyzer::IsHangingWindow(int64_t bits_received, ...@@ -234,7 +234,7 @@ bool ThroughputAnalyzer::IsHangingWindow(int64_t bits_received,
// Scale the |duration| to one HTTP RTT, and compute the number of bits that // Scale the |duration| to one HTTP RTT, and compute the number of bits that
// would be received over a duration of one HTTP RTT. // would be received over a duration of one HTTP RTT.
size_t bits_received_over_one_http_rtt = size_t bits_received_over_one_http_rtt =
bits_received * (network_quality_provider_->GetHttpRTT() bits_received * (network_quality_estimator_->GetHttpRTT()
.value_or(base::TimeDelta::FromSeconds(10)) .value_or(base::TimeDelta::FromSeconds(10))
.InMillisecondsF() / .InMillisecondsF() /
duration.InMillisecondsF()); duration.InMillisecondsF());
...@@ -394,7 +394,7 @@ void ThroughputAnalyzer::EraseHangingRequests(const URLRequest& request) { ...@@ -394,7 +394,7 @@ void ThroughputAnalyzer::EraseHangingRequests(const URLRequest& request) {
const base::TimeTicks now = tick_clock_->NowTicks(); const base::TimeTicks now = tick_clock_->NowTicks();
const base::TimeDelta http_rtt = const base::TimeDelta http_rtt =
network_quality_provider_->GetHttpRTT().value_or( network_quality_estimator_->GetHttpRTT().value_or(
base::TimeDelta::FromSeconds(60)); base::TimeDelta::FromSeconds(60));
size_t count_request_erased = 0; size_t count_request_erased = 0;
......
...@@ -28,7 +28,7 @@ class TickClock; ...@@ -28,7 +28,7 @@ class TickClock;
namespace net { namespace net {
class NetworkQualityEstimatorParams; class NetworkQualityEstimatorParams;
class NetworkQualityProvider; class NetworkQualityEstimator;
class URLRequest; class URLRequest;
namespace nqe { namespace nqe {
...@@ -59,7 +59,7 @@ class NET_EXPORT_PRIVATE ThroughputAnalyzer { ...@@ -59,7 +59,7 @@ class NET_EXPORT_PRIVATE ThroughputAnalyzer {
// estimation. // estimation.
// Virtualized for testing. // Virtualized for testing.
ThroughputAnalyzer( ThroughputAnalyzer(
const NetworkQualityProvider* network_quality_provider, const NetworkQualityEstimator* network_quality_estimator,
const NetworkQualityEstimatorParams* params, const NetworkQualityEstimatorParams* params,
scoped_refptr<base::SingleThreadTaskRunner> task_runner, scoped_refptr<base::SingleThreadTaskRunner> task_runner,
ThroughputObservationCallback throughput_observation_callback, ThroughputObservationCallback throughput_observation_callback,
...@@ -162,7 +162,7 @@ class NET_EXPORT_PRIVATE ThroughputAnalyzer { ...@@ -162,7 +162,7 @@ class NET_EXPORT_PRIVATE ThroughputAnalyzer {
void BoundRequestsSize(); void BoundRequestsSize();
// Guaranteed to be non-null during the duration of |this|. // Guaranteed to be non-null during the duration of |this|.
const NetworkQualityProvider* network_quality_provider_; const NetworkQualityEstimator* network_quality_estimator_;
// Guaranteed to be non-null during the duration of |this|. // Guaranteed to be non-null during the duration of |this|.
const NetworkQualityEstimatorParams* params_; const NetworkQualityEstimatorParams* params_;
......
This diff is collapsed.
...@@ -42,7 +42,7 @@ ClientSocketPoolManagerImpl::ClientSocketPoolManagerImpl( ...@@ -42,7 +42,7 @@ ClientSocketPoolManagerImpl::ClientSocketPoolManagerImpl(
NetLog* net_log, NetLog* net_log,
ClientSocketFactory* socket_factory, ClientSocketFactory* socket_factory,
SocketPerformanceWatcherFactory* socket_performance_watcher_factory, SocketPerformanceWatcherFactory* socket_performance_watcher_factory,
NetworkQualityProvider* network_quality_provider, NetworkQualityEstimator* network_quality_estimator,
HostResolver* host_resolver, HostResolver* host_resolver,
CertVerifier* cert_verifier, CertVerifier* cert_verifier,
ChannelIDService* channel_id_service, ChannelIDService* channel_id_service,
...@@ -56,7 +56,7 @@ ClientSocketPoolManagerImpl::ClientSocketPoolManagerImpl( ...@@ -56,7 +56,7 @@ ClientSocketPoolManagerImpl::ClientSocketPoolManagerImpl(
: net_log_(net_log), : net_log_(net_log),
socket_factory_(socket_factory), socket_factory_(socket_factory),
socket_performance_watcher_factory_(socket_performance_watcher_factory), socket_performance_watcher_factory_(socket_performance_watcher_factory),
network_quality_provider_(network_quality_provider), network_quality_estimator_(network_quality_estimator),
host_resolver_(host_resolver), host_resolver_(host_resolver),
cert_verifier_(cert_verifier), cert_verifier_(cert_verifier),
channel_id_service_(channel_id_service), channel_id_service_(channel_id_service),
...@@ -304,7 +304,7 @@ ClientSocketPoolManagerImpl::GetSocketPoolForHTTPProxy( ...@@ -304,7 +304,7 @@ ClientSocketPoolManagerImpl::GetSocketPoolForHTTPProxy(
sockets_per_proxy_server, sockets_per_group, sockets_per_proxy_server, sockets_per_group,
tcp_http_ret.first->second.get(), tcp_http_ret.first->second.get(),
ssl_https_ret.first->second.get(), ssl_https_ret.first->second.get(),
network_quality_provider_, net_log_))); network_quality_estimator_, net_log_)));
return ret.first->second.get(); return ret.first->second.get();
} }
......
...@@ -34,7 +34,7 @@ class CTVerifier; ...@@ -34,7 +34,7 @@ class CTVerifier;
class HttpProxyClientSocketPool; class HttpProxyClientSocketPool;
class HostResolver; class HostResolver;
class NetLog; class NetLog;
class NetworkQualityProvider; class NetworkQualityEstimator;
class SocketPerformanceWatcherFactory; class SocketPerformanceWatcherFactory;
class SOCKSClientSocketPool; class SOCKSClientSocketPool;
class SSLClientSocketPool; class SSLClientSocketPool;
...@@ -51,7 +51,7 @@ class NET_EXPORT_PRIVATE ClientSocketPoolManagerImpl ...@@ -51,7 +51,7 @@ class NET_EXPORT_PRIVATE ClientSocketPoolManagerImpl
NetLog* net_log, NetLog* net_log,
ClientSocketFactory* socket_factory, ClientSocketFactory* socket_factory,
SocketPerformanceWatcherFactory* socket_performance_watcher_factory, SocketPerformanceWatcherFactory* socket_performance_watcher_factory,
NetworkQualityProvider* network_quality_provider, NetworkQualityEstimator* network_quality_estimator,
HostResolver* host_resolver, HostResolver* host_resolver,
CertVerifier* cert_verifier, CertVerifier* cert_verifier,
ChannelIDService* channel_id_service, ChannelIDService* channel_id_service,
...@@ -103,7 +103,7 @@ class NET_EXPORT_PRIVATE ClientSocketPoolManagerImpl ...@@ -103,7 +103,7 @@ class NET_EXPORT_PRIVATE ClientSocketPoolManagerImpl
NetLog* const net_log_; NetLog* const net_log_;
ClientSocketFactory* const socket_factory_; ClientSocketFactory* const socket_factory_;
SocketPerformanceWatcherFactory* socket_performance_watcher_factory_; SocketPerformanceWatcherFactory* socket_performance_watcher_factory_;
NetworkQualityProvider* network_quality_provider_; NetworkQualityEstimator* network_quality_estimator_;
HostResolver* const host_resolver_; HostResolver* const host_resolver_;
CertVerifier* const cert_verifier_; CertVerifier* const cert_verifier_;
ChannelIDService* const channel_id_service_; ChannelIDService* const channel_id_service_;
......
...@@ -243,7 +243,7 @@ void URLRequestContextBuilder::SetHttpNetworkSessionComponents( ...@@ -243,7 +243,7 @@ void URLRequestContextBuilder::SetHttpNetworkSessionComponents(
request_context->http_server_properties(); request_context->http_server_properties();
session_context->net_log = request_context->net_log(); session_context->net_log = request_context->net_log();
session_context->channel_id_service = request_context->channel_id_service(); session_context->channel_id_service = request_context->channel_id_service();
session_context->network_quality_provider = session_context->network_quality_estimator =
request_context->network_quality_estimator(); request_context->network_quality_estimator();
if (request_context->network_quality_estimator()) { if (request_context->network_quality_estimator()) {
session_context->socket_performance_watcher_factory = session_context->socket_performance_watcher_factory =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment