| 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 | |
| 9 namespace nqe { | 8 namespace nqe { |
| 10 | |
| 11 namespace internal { | 9 namespace internal { |
| 12 | 10 |
| 13 base::TimeDelta InvalidRTT() { | 11 base::TimeDelta InvalidRTT() { |
| 14 return base::TimeDelta::Max(); | 12 return base::TimeDelta::Max(); |
| 15 } | 13 } |
| 16 | 14 |
| 17 NetworkQuality::NetworkQuality() | 15 NetworkQuality::NetworkQuality() |
| 18 : NetworkQuality(InvalidRTT(), InvalidRTT(), kInvalidThroughput) {} | 16 : NetworkQuality(InvalidRTT(), InvalidRTT(), kInvalidThroughput) {} |
| 19 | 17 |
| 20 NetworkQuality::NetworkQuality(const base::TimeDelta& http_rtt, | 18 NetworkQuality::NetworkQuality(const base::TimeDelta& http_rtt, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 33 | 31 |
| 34 NetworkQuality::~NetworkQuality() {} | 32 NetworkQuality::~NetworkQuality() {} |
| 35 | 33 |
| 36 NetworkQuality& NetworkQuality::operator=(const NetworkQuality& other) { | 34 NetworkQuality& NetworkQuality::operator=(const NetworkQuality& other) { |
| 37 http_rtt_ = other.http_rtt_; | 35 http_rtt_ = other.http_rtt_; |
| 38 transport_rtt_ = other.transport_rtt_; | 36 transport_rtt_ = other.transport_rtt_; |
| 39 downstream_throughput_kbps_ = other.downstream_throughput_kbps_; | 37 downstream_throughput_kbps_ = other.downstream_throughput_kbps_; |
| 40 return *this; | 38 return *this; |
| 41 } | 39 } |
| 42 | 40 |
| 41 bool NetworkQuality::operator==(const NetworkQuality& other) const { |
| 42 return http_rtt_ == other.http_rtt_ && |
| 43 transport_rtt_ == other.transport_rtt_ && |
| 44 downstream_throughput_kbps_ == other.downstream_throughput_kbps_; |
| 45 } |
| 46 |
| 43 } // namespace internal | 47 } // namespace internal |
| 44 | |
| 45 } // namespace nqe | 48 } // namespace nqe |
| 46 | |
| 47 } // namespace net | 49 } // namespace net |
| OLD | NEW |