| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |