OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "net/base/network_quality.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 |
| 9 namespace { |
| 10 |
| 11 // If two double values are within |kDelta| of each other, they are assumed to |
| 12 // be equal. |
| 13 const double kDelta = 0.001; |
| 14 |
| 15 } // namespace |
| 16 |
| 17 namespace net { |
| 18 |
| 19 NetworkQuality::NetworkQuality(const base::TimeDelta& rtt, |
| 20 uint64_t downlink_throughput_kbps, |
| 21 double confidence) |
| 22 : rtt_(rtt), |
| 23 downlink_throughput_kbps_(downlink_throughput_kbps), |
| 24 confidence_(confidence) { |
| 25 DCHECK_GE(rtt_, base::TimeDelta()); |
| 26 DCHECK_GE(downlink_throughput_kbps_, 0U); |
| 27 DCHECK_GE(confidence_, 0 - kDelta); |
| 28 DCHECK_LE(confidence_, 1 + kDelta); |
| 29 } |
| 30 |
| 31 NetworkQuality::~NetworkQuality() { |
| 32 } |
| 33 |
| 34 } // namespace net |
OLD | NEW |