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

Side by Side 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, 4 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/nqe/network_quality.h" 5 #include "net/nqe/network_quality.h"
6 6
7 namespace net { 7 namespace net {
8 namespace nqe { 8 namespace nqe {
9 namespace internal { 9 namespace internal {
10 10
(...skipping 26 matching lines...) Expand all
37 downstream_throughput_kbps_ = other.downstream_throughput_kbps_; 37 downstream_throughput_kbps_ = other.downstream_throughput_kbps_;
38 return *this; 38 return *this;
39 } 39 }
40 40
41 bool NetworkQuality::operator==(const NetworkQuality& other) const { 41 bool NetworkQuality::operator==(const NetworkQuality& other) const {
42 return http_rtt_ == other.http_rtt_ && 42 return http_rtt_ == other.http_rtt_ &&
43 transport_rtt_ == other.transport_rtt_ && 43 transport_rtt_ == other.transport_rtt_ &&
44 downstream_throughput_kbps_ == other.downstream_throughput_kbps_; 44 downstream_throughput_kbps_ == other.downstream_throughput_kbps_;
45 } 45 }
46 46
47 bool NetworkQuality::IsFaster(const NetworkQuality& other) const {
48 return (http_rtt() == InvalidRTT() || other.http_rtt() == InvalidRTT() ||
49 http_rtt() <= other.http_rtt()) &&
50 (transport_rtt() == InvalidRTT() ||
51 other.transport_rtt() == InvalidRTT() ||
52 transport_rtt() <= other.transport_rtt()) &&
53 (downstream_throughput_kbps() == kInvalidThroughput ||
54 other.downstream_throughput_kbps() == kInvalidThroughput ||
55 downstream_throughput_kbps() >= other.downstream_throughput_kbps());
56 }
57
47 } // namespace internal 58 } // namespace internal
48 } // namespace nqe 59 } // namespace nqe
49 } // namespace net 60 } // namespace net
OLDNEW
« 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