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_packet_creator.h" | 5 #include "net/quic/quic_packet_creator.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "net/quic/crypto/null_encrypter.h" | 8 #include "net/quic/crypto/null_encrypter.h" |
9 #include "net/quic/crypto/quic_decrypter.h" | 9 #include "net/quic/crypto/quic_decrypter.h" |
10 #include "net/quic/crypto/quic_encrypter.h" | 10 #include "net/quic/crypto/quic_encrypter.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // Returns the number of bytes of overhead that will be added to a packet | 111 // Returns the number of bytes of overhead that will be added to a packet |
112 // of maximum length. | 112 // of maximum length. |
113 size_t GetEncryptionOverhead() { | 113 size_t GetEncryptionOverhead() { |
114 return creator_.max_packet_length() - client_framer_.GetMaxPlaintextSize( | 114 return creator_.max_packet_length() - client_framer_.GetMaxPlaintextSize( |
115 creator_.max_packet_length()); | 115 creator_.max_packet_length()); |
116 } | 116 } |
117 | 117 |
118 // Returns the number of bytes consumed by the non-data fields of a stream | 118 // Returns the number of bytes consumed by the non-data fields of a stream |
119 // frame, assuming it is the last frame in the packet | 119 // frame, assuming it is the last frame in the packet |
120 size_t GetStreamFrameOverhead(InFecGroup is_in_fec_group) { | 120 size_t GetStreamFrameOverhead(InFecGroup is_in_fec_group) { |
121 return QuicFramer::GetMinStreamFrameSize(client_framer_.version(), | 121 return QuicFramer::GetMinStreamFrameSize(kClientDataStreamId1, kOffset, |
122 kClientDataStreamId1, kOffset, | |
123 true, is_in_fec_group); | 122 true, is_in_fec_group); |
124 } | 123 } |
125 | 124 |
126 // Enables and turns on FEC protection. Returns true if FEC protection is on. | 125 // Enables and turns on FEC protection. Returns true if FEC protection is on. |
127 bool SwitchFecProtectionOn(size_t max_packets_per_fec_group) { | 126 bool SwitchFecProtectionOn(size_t max_packets_per_fec_group) { |
128 creator_.set_max_packets_per_fec_group(max_packets_per_fec_group); | 127 creator_.set_max_packets_per_fec_group(max_packets_per_fec_group); |
129 creator_.StartFecProtectingPackets(); | 128 creator_.StartFecProtectingPackets(); |
130 return creator_.IsFecProtected(); | 129 return creator_.IsFecProtected(); |
131 } | 130 } |
132 | 131 |
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 // After 64 calls, BoolSource will refresh the bucket - make sure it does. | 1012 // After 64 calls, BoolSource will refresh the bucket - make sure it does. |
1014 mock_random_.ChangeValue(); | 1013 mock_random_.ChangeValue(); |
1015 } | 1014 } |
1016 | 1015 |
1017 delete frames_[0].stream_frame; | 1016 delete frames_[0].stream_frame; |
1018 } | 1017 } |
1019 | 1018 |
1020 } // namespace | 1019 } // namespace |
1021 } // namespace test | 1020 } // namespace test |
1022 } // namespace net | 1021 } // namespace net |
OLD | NEW |