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

Unified Diff: net/nqe/network_quality_estimator.cc

Issue 1998683003: Return E_C_T_OFFLINE when the device is offline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 7 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 | « no previous file | net/nqe/network_quality_estimator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/network_quality_estimator.cc
diff --git a/net/nqe/network_quality_estimator.cc b/net/nqe/network_quality_estimator.cc
index 3e03a8e4e4987cfc52f72d8629f721914c559be0..a9596d04815ee479e0534f05a0510866e4a809f9 100644
--- a/net/nqe/network_quality_estimator.cc
+++ b/net/nqe/network_quality_estimator.cc
@@ -692,6 +692,11 @@ NetworkQualityEstimator::EffectiveConnectionType
NetworkQualityEstimator::GetEffectiveConnectionType() const {
DCHECK(thread_checker_.CalledOnValidThread());
+ // If the device is currently offline, then return
+ // EFFECTIVE_CONNECTION_TYPE_OFFLINE.
+ if (GetCurrentNetworkID().type == NetworkChangeNotifier::CONNECTION_NONE)
+ return EFFECTIVE_CONNECTION_TYPE_OFFLINE;
+
base::TimeDelta url_request_rtt = nqe::internal::InvalidRTT();
if (!GetURLRequestRTTEstimate(&url_request_rtt))
url_request_rtt = nqe::internal::InvalidRTT();
« no previous file with comments | « no previous file | net/nqe/network_quality_estimator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698