OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_sent_packet_manager.h" | 5 #include "net/quic/quic_sent_packet_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // per draft RFC draft-dukkipati-tcpm-tcp-loss-probe. | 44 // per draft RFC draft-dukkipati-tcpm-tcp-loss-probe. |
45 static const size_t kDefaultMaxTailLossProbes = 2; | 45 static const size_t kDefaultMaxTailLossProbes = 2; |
46 static const int64 kMinTailLossProbeTimeoutMs = 10; | 46 static const int64 kMinTailLossProbeTimeoutMs = 10; |
47 | 47 |
48 // Number of samples before we force a new recent min rtt to be captured. | 48 // Number of samples before we force a new recent min rtt to be captured. |
49 static const size_t kNumMinRttSamplesAfterQuiescence = 2; | 49 static const size_t kNumMinRttSamplesAfterQuiescence = 2; |
50 | 50 |
51 // Number of unpaced packets to send after quiescence. | 51 // Number of unpaced packets to send after quiescence. |
52 static const size_t kInitialUnpacedBurst = 10; | 52 static const size_t kInitialUnpacedBurst = 10; |
53 | 53 |
54 // Fraction of the receive buffer that can be used for encrypted bytes. | |
55 // Allows a 5% overhead for IP and UDP framing, as well as ack only packets. | |
56 static const float kUsableRecieveBufferFraction = 0.95f; | |
57 | |
58 bool HasCryptoHandshake(const TransmissionInfo& transmission_info) { | 54 bool HasCryptoHandshake(const TransmissionInfo& transmission_info) { |
59 if (transmission_info.retransmittable_frames == nullptr) { | 55 if (transmission_info.retransmittable_frames == nullptr) { |
60 return false; | 56 return false; |
61 } | 57 } |
62 return transmission_info.retransmittable_frames->HasCryptoHandshake() == | 58 return transmission_info.retransmittable_frames->HasCryptoHandshake() == |
63 IS_HANDSHAKE; | 59 IS_HANDSHAKE; |
64 } | 60 } |
65 | 61 |
66 } // namespace | 62 } // namespace |
67 | 63 |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 // Set up a pacing sender with a 1 millisecond alarm granularity, the same as | 967 // Set up a pacing sender with a 1 millisecond alarm granularity, the same as |
972 // the default granularity of the Linux kernel's FQ qdisc. | 968 // the default granularity of the Linux kernel's FQ qdisc. |
973 using_pacing_ = true; | 969 using_pacing_ = true; |
974 send_algorithm_.reset( | 970 send_algorithm_.reset( |
975 new PacingSender(send_algorithm_.release(), | 971 new PacingSender(send_algorithm_.release(), |
976 QuicTime::Delta::FromMilliseconds(1), | 972 QuicTime::Delta::FromMilliseconds(1), |
977 kInitialUnpacedBurst)); | 973 kInitialUnpacedBurst)); |
978 } | 974 } |
979 | 975 |
980 } // namespace net | 976 } // namespace net |
OLD | NEW |