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

Unified Diff: net/nqe/network_quality_estimator.cc

Issue 1991933002: Return E_C_T_OFFLINE when the device is offline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 309ebe8c55a47a6f45a8eeac962fdab861ec841e..8c679299860777ac75ff2b747ce49f1388accfaf 100644
--- a/net/nqe/network_quality_estimator.cc
+++ b/net/nqe/network_quality_estimator.cc
@@ -667,6 +667,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