Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(557)

Side by Side Diff: net/quic/quic_bandwidth.h

Issue 1809123002: Pass QuicTime, QuicTime::Delta, and QuicBandwidth exclusively by value. Not flag protected. No func… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@116970314
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/congestion_control/loss_detection_interface.h ('k') | net/quic/quic_bandwidth.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // QuicBandwidth represents a bandwidth, stored in bits per second resolution. 5 // QuicBandwidth represents a bandwidth, stored in bits per second resolution.
6 6
7 #ifndef NET_QUIC_QUIC_BANDWIDTH_H_ 7 #ifndef NET_QUIC_QUIC_BANDWIDTH_H_
8 #define NET_QUIC_QUIC_BANDWIDTH_H_ 8 #define NET_QUIC_QUIC_BANDWIDTH_H_
9 9
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 int64_t ToBytesPerSecond() const; 45 int64_t ToBytesPerSecond() const;
46 46
47 int64_t ToKBytesPerSecond() const; 47 int64_t ToKBytesPerSecond() const;
48 48
49 QuicByteCount ToBytesPerPeriod(QuicTime::Delta time_period) const; 49 QuicByteCount ToBytesPerPeriod(QuicTime::Delta time_period) const;
50 50
51 int64_t ToKBytesPerPeriod(QuicTime::Delta time_period) const; 51 int64_t ToKBytesPerPeriod(QuicTime::Delta time_period) const;
52 52
53 bool IsZero() const; 53 bool IsZero() const;
54 54
55 QuicBandwidth Add(const QuicBandwidth& delta) const WARN_UNUSED_RESULT; 55 QuicBandwidth Add(QuicBandwidth delta) const WARN_UNUSED_RESULT;
56 56
57 QuicBandwidth Subtract(const QuicBandwidth& delta) const WARN_UNUSED_RESULT; 57 QuicBandwidth Subtract(QuicBandwidth delta) const WARN_UNUSED_RESULT;
58 58
59 QuicBandwidth Scale(float scale_factor) const WARN_UNUSED_RESULT; 59 QuicBandwidth Scale(float scale_factor) const WARN_UNUSED_RESULT;
60 60
61 QuicTime::Delta TransferTime(QuicByteCount bytes) const; 61 QuicTime::Delta TransferTime(QuicByteCount bytes) const;
62 62
63 private: 63 private:
64 explicit QuicBandwidth(int64_t bits_per_second); 64 explicit QuicBandwidth(int64_t bits_per_second);
65 int64_t bits_per_second_; 65 int64_t bits_per_second_;
66 }; 66 };
67 67
(...skipping 12 matching lines...) Expand all
80 } 80 }
81 inline bool operator<=(QuicBandwidth lhs, QuicBandwidth rhs) { 81 inline bool operator<=(QuicBandwidth lhs, QuicBandwidth rhs) {
82 return !(rhs < lhs); 82 return !(rhs < lhs);
83 } 83 }
84 inline bool operator>=(QuicBandwidth lhs, QuicBandwidth rhs) { 84 inline bool operator>=(QuicBandwidth lhs, QuicBandwidth rhs) {
85 return !(lhs < rhs); 85 return !(lhs < rhs);
86 } 86 }
87 87
88 } // namespace net 88 } // namespace net
89 #endif // NET_QUIC_QUIC_BANDWIDTH_H_ 89 #endif // NET_QUIC_QUIC_BANDWIDTH_H_
OLDNEW
« no previous file with comments | « net/quic/congestion_control/loss_detection_interface.h ('k') | net/quic/quic_bandwidth.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698