| 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/quic_bandwidth.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/time.h" | 8 #include "base/time.h" |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| 11 | 11 |
| 12 // Highest number that QuicBandwidth can hold. | 12 // Highest number that QuicBandwidth can hold. |
| 13 const int64 kQuicInfiniteBandwidth = 0x7fffffffffffffffll; | 13 const int64 kQuicInfiniteBandwidth = GG_INT64_C(0x7fffffffffffffff); |
| 14 | 14 |
| 15 // static | 15 // static |
| 16 QuicBandwidth QuicBandwidth::Zero() { | 16 QuicBandwidth QuicBandwidth::Zero() { |
| 17 return QuicBandwidth(0); | 17 return QuicBandwidth(0); |
| 18 } | 18 } |
| 19 | 19 |
| 20 // static | 20 // static |
| 21 QuicBandwidth QuicBandwidth::FromBitsPerSecond(int64 bits_per_second) { | 21 QuicBandwidth QuicBandwidth::FromBitsPerSecond(int64 bits_per_second) { |
| 22 return QuicBandwidth(bits_per_second); | 22 return QuicBandwidth(bits_per_second); |
| 23 } | 23 } |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 QuicBandwidth QuicBandwidth::Subtract(const QuicBandwidth& delta) const { | 94 QuicBandwidth QuicBandwidth::Subtract(const QuicBandwidth& delta) const { |
| 95 return QuicBandwidth(bits_per_second_ - delta.bits_per_second_); | 95 return QuicBandwidth(bits_per_second_ - delta.bits_per_second_); |
| 96 } | 96 } |
| 97 | 97 |
| 98 QuicBandwidth QuicBandwidth::Scale(float scale_factor) const { | 98 QuicBandwidth QuicBandwidth::Scale(float scale_factor) const { |
| 99 return QuicBandwidth(bits_per_second_ * scale_factor); | 99 return QuicBandwidth(bits_per_second_ * scale_factor); |
| 100 } | 100 } |
| 101 | 101 |
| 102 } // namespace net | 102 } // namespace net |
| OLD | NEW |