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

Unified Diff: net/nqe/network_quality_estimator.cc

Issue 2081493002: Obtain WiFi SSID on Android using Android APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 4 years, 6 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.cc
diff --git a/net/nqe/network_quality_estimator.cc b/net/nqe/network_quality_estimator.cc
index 93e177d07803d2e5bf6a3798106f1792a317f7ad..83a86fa78a3209d22bd88dd9453a06e784bb54a0 100644
--- a/net/nqe/network_quality_estimator.cc
+++ b/net/nqe/network_quality_estimator.cc
@@ -654,7 +654,10 @@ void NetworkQualityEstimator::OnConnectionTypeChanged(
peak_network_quality_ = nqe::internal::NetworkQuality();
downstream_throughput_kbps_observations_.Clear();
rtt_observations_.Clear();
+
+ // Update the local state for the new connection.
current_network_id_ = GetCurrentNetworkID();
+ RecordNetworkIDAvailability();
// Query the external estimate provider on certain connection types. Once the
// updated estimates are available, OnUpdatedEstimateAvailable will be called
@@ -749,6 +752,16 @@ void NetworkQualityEstimator::RecordMetricsOnConnectionTypeChanged() const {
}
}
+void NetworkQualityEstimator::RecordNetworkIDAvailability() const {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ if (current_network_id_.type ==
+ NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI ||
+ NetworkChangeNotifier::IsConnectionCellular(current_network_id_.type)) {
+ UMA_HISTOGRAM_BOOLEAN("NQE.NetworkIdAvailable",
+ !current_network_id_.id.empty());
+ }
+}
+
void NetworkQualityEstimator::RecordMetricsOnMainFrameRequest() const {
DCHECK(thread_checker_.CalledOnValidThread());

Powered by Google App Engine
This is Rietveld 408576698