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

Unified Diff: net/nqe/network_quality_estimator.h

Issue 2593243003: Add network quality change events to net log (Closed)
Patch Set: ps Created 3 years, 11 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 d0183706aec15da3141a34aea2862bd8b312835c..bb63c163b60a64ae514cb16ea6a780a01fd4468a 100644
--- a/net/nqe/network_quality_estimator.h
+++ b/net/nqe/network_quality_estimator.h
@@ -21,6 +21,7 @@
#include "base/time/time.h"
#include "net/base/net_export.h"
#include "net/base/network_change_notifier.h"
+#include "net/log/net_log_with_source.h"
#include "net/nqe/cached_network_quality.h"
#include "net/nqe/effective_connection_type.h"
#include "net/nqe/external_estimate_provider.h"
@@ -38,6 +39,8 @@ class TickClock;
namespace net {
+class NetLog;
+
namespace nqe {
namespace internal {
class ThroughputAnalyzer;
@@ -176,10 +179,12 @@ class NET_EXPORT NetworkQualityEstimator
// Creates a new NetworkQualityEstimator.
// |variation_params| is the map containing all field trial parameters
// related to NetworkQualityEstimator field trial.
- // |external_estimates_provider| may be NULL.
+ // |external_estimates_provider| may be NULL. |net_log| is guaranteed to be
RyanSturm 2017/01/10 16:22:37 Can you rephrase this to something like "The embed
tbansal1 2017/01/10 18:27:53 Done.
+ // non-null.
NetworkQualityEstimator(
std::unique_ptr<ExternalEstimateProvider> external_estimates_provider,
- const std::map<std::string, std::string>& variation_params);
+ const std::map<std::string, std::string>& variation_params,
+ NetLog* net_log);
// Construct a NetworkQualityEstimator instance allowing for test
// configuration. Registers for network type change notifications so estimates
@@ -192,12 +197,13 @@ class NET_EXPORT NetworkQualityEstimator
// used for network quality estimation.
// |use_smaller_responses_for_tests| should only be true when testing.
// Allows the responses smaller than |kMinTransferSizeInBits| to be used for
- // network quality estimation.
+ // network quality estimation. |net_log| is guaranteed to be non-null.
RyanSturm 2017/01/10 16:22:37 same as above comment
tbansal1 2017/01/10 18:27:53 Done.
NetworkQualityEstimator(
std::unique_ptr<ExternalEstimateProvider> external_estimates_provider,
const std::map<std::string, std::string>& variation_params,
bool use_local_host_requests_for_tests,
- bool use_smaller_responses_for_tests);
+ bool use_smaller_responses_for_tests,
+ NetLog* net_log);
~NetworkQualityEstimator() override;
@@ -305,7 +311,8 @@ class NET_EXPORT NetworkQualityEstimator
const std::map<std::string, std::string>& variation_params,
bool use_local_host_requests_for_tests,
bool use_smaller_responses_for_tests,
- bool add_default_platform_observations);
+ bool add_default_platform_observations,
+ const NetLogWithSource& net_log);
// NetworkChangeNotifier::ConnectionTypeObserver implementation:
void OnConnectionTypeChanged(
@@ -505,7 +512,13 @@ class NET_EXPORT NetworkQualityEstimator
void MaybeComputeEffectiveConnectionType();
// Notifies observers of a change in effective connection type.
- void NotifyObserversOfEffectiveConnectionTypeChanged();
+ // |http_rtt| is the estimate of the HTTP RTT. |transport_rtt| is the estimate
+ // of the transport RTT. |downstream_throughput_kbps| is the estimate of the
RyanSturm 2017/01/10 16:22:37 units for the RTTs (msec)
tbansal1 2017/01/10 18:27:53 RTTs are in base::TimeDelta. So, units are not req
+ // downstream throughput (in kilobits per second).
+ void NotifyObserversOfEffectiveConnectionTypeChanged(
+ base::TimeDelta http_rtt,
+ base::TimeDelta transport_rtt,
+ int32_t downstream_throughput_kbps);
// Notifies the observers of RTT or throughput estimates computation.
void NotifyObserversOfRTTOrThroughputComputed() const;
@@ -741,6 +754,8 @@ class NET_EXPORT NetworkQualityEstimator
base::ThreadChecker thread_checker_;
+ NetLogWithSource net_log_;
+
base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator);

Powered by Google App Engine
This is Rietveld 408576698