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

Unified Diff: net/nqe/network_quality_estimator.h

Issue 2593243003: Add network quality change events to net log (Closed)
Patch Set: rebased 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
« no previous file with comments | « net/nqe/event_creator.cc ('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 e4a9d97471a3e487e4987df663d54f3375c8960f..457367491fdabc5e8b3bbfe4b87def35402c44cd 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. The caller must guarantee that
+ // |net_log| outlives |this|.
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,14 @@ 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. The caller must guarantee that |net_log|
+ // outlives |this|.
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;
@@ -310,7 +317,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(
@@ -755,6 +763,8 @@ class NET_EXPORT NetworkQualityEstimator
base::ThreadChecker thread_checker_;
+ NetLogWithSource net_log_;
+
base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator);
« no previous file with comments | « net/nqe/event_creator.cc ('k') | net/nqe/network_quality_estimator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698