| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/quic/core/quic_bandwidth.h" | 5 #include "net/quic/core/quic_bandwidth.h" |
| 6 | 6 |
| 7 #include <cinttypes> | 7 #include <cinttypes> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "net/quic/core/quic_bug_tracker.h" | |
| 13 #include "net/quic/core/quic_constants.h" | 12 #include "net/quic/core/quic_constants.h" |
| 14 #include "net/quic/core/quic_time.h" | 13 #include "net/quic/core/quic_time.h" |
| 15 #include "net/quic/core/quic_types.h" | 14 #include "net/quic/core/quic_types.h" |
| 15 #include "net/quic/platform/api/quic_bug_tracker.h" |
| 16 | 16 |
| 17 using base::StringPrintf; | 17 using base::StringPrintf; |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 | 20 |
| 21 // Highest number that QuicBandwidth can hold. | 21 // Highest number that QuicBandwidth can hold. |
| 22 const int64_t kQuicInfiniteBandwidth = INT64_C(0x7fffffffffffffff); | 22 const int64_t kQuicInfiniteBandwidth = INT64_C(0x7fffffffffffffff); |
| 23 | 23 |
| 24 // static | 24 // static |
| 25 QuicBandwidth QuicBandwidth::Zero() { | 25 QuicBandwidth QuicBandwidth::Zero() { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 } | 133 } |
| 134 | 134 |
| 135 double bits_per_second_with_unit = bits_per_second_ / divisor; | 135 double bits_per_second_with_unit = bits_per_second_ / divisor; |
| 136 double bytes_per_second_with_unit = bits_per_second_with_unit / 8; | 136 double bytes_per_second_with_unit = bits_per_second_with_unit / 8; |
| 137 return StringPrintf("%.2f %cbits/s (%.2f %cbytes/s)", | 137 return StringPrintf("%.2f %cbits/s (%.2f %cbytes/s)", |
| 138 bits_per_second_with_unit, unit, | 138 bits_per_second_with_unit, unit, |
| 139 bytes_per_second_with_unit, unit); | 139 bytes_per_second_with_unit, unit); |
| 140 } | 140 } |
| 141 | 141 |
| 142 } // namespace net | 142 } // namespace net |
| OLD | NEW |