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

Unified Diff: net/nqe/network_quality.cc

Issue 2172403002: Provide default thresholds for effective connection types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bengr comments Created 4 years, 5 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/network_quality.h ('k') | net/nqe/network_quality_estimator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/network_quality.cc
diff --git a/net/nqe/network_quality.cc b/net/nqe/network_quality.cc
index 1132b0eb9e5a437e8562c483093550c14c9209c7..6831dd4b2135ed838cee6d8bda37f2007ff0b1c0 100644
--- a/net/nqe/network_quality.cc
+++ b/net/nqe/network_quality.cc
@@ -44,6 +44,17 @@ bool NetworkQuality::operator==(const NetworkQuality& other) const {
downstream_throughput_kbps_ == other.downstream_throughput_kbps_;
}
+bool NetworkQuality::IsFaster(const NetworkQuality& other) const {
+ return (http_rtt() == InvalidRTT() || other.http_rtt() == InvalidRTT() ||
+ http_rtt() <= other.http_rtt()) &&
+ (transport_rtt() == InvalidRTT() ||
+ other.transport_rtt() == InvalidRTT() ||
+ transport_rtt() <= other.transport_rtt()) &&
+ (downstream_throughput_kbps() == kInvalidThroughput ||
+ other.downstream_throughput_kbps() == kInvalidThroughput ||
+ downstream_throughput_kbps() >= other.downstream_throughput_kbps());
+}
+
} // namespace internal
} // namespace nqe
} // namespace net
« no previous file with comments | « net/nqe/network_quality.h ('k') | net/nqe/network_quality_estimator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698