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/quic_bandwidth.h" | 5 #include "net/quic/core/quic_bandwidth.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "net/quic/quic_bug_tracker.h" | 10 #include "net/quic/core/quic_bug_tracker.h" |
11 #include "net/quic/quic_time.h" | 11 #include "net/quic/core/quic_time.h" |
12 #include "net/quic/quic_types.h" | 12 #include "net/quic/core/quic_types.h" |
13 | 13 |
14 namespace net { | 14 namespace net { |
15 | 15 |
16 // Highest number that QuicBandwidth can hold. | 16 // Highest number that QuicBandwidth can hold. |
17 const int64_t kQuicInfiniteBandwidth = INT64_C(0x7fffffffffffffff); | 17 const int64_t kQuicInfiniteBandwidth = INT64_C(0x7fffffffffffffff); |
18 | 18 |
19 // static | 19 // static |
20 QuicBandwidth QuicBandwidth::Zero() { | 20 QuicBandwidth QuicBandwidth::Zero() { |
21 return QuicBandwidth(0); | 21 return QuicBandwidth(0); |
22 } | 22 } |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 QuicTime::Delta QuicBandwidth::TransferTime(QuicByteCount bytes) const { | 98 QuicTime::Delta QuicBandwidth::TransferTime(QuicByteCount bytes) const { |
99 if (bits_per_second_ == 0) { | 99 if (bits_per_second_ == 0) { |
100 return QuicTime::Delta::Zero(); | 100 return QuicTime::Delta::Zero(); |
101 } | 101 } |
102 return QuicTime::Delta::FromMicroseconds(bytes * 8 * kNumMicrosPerSecond / | 102 return QuicTime::Delta::FromMicroseconds(bytes * 8 * kNumMicrosPerSecond / |
103 bits_per_second_); | 103 bits_per_second_); |
104 } | 104 } |
105 | 105 |
106 } // namespace net | 106 } // namespace net |
OLD | NEW |