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 #ifndef NET_QUIC_QUIC_PROTOCOL_H_ | 5 #ifndef NET_QUIC_QUIC_PROTOCOL_H_ |
6 #define NET_QUIC_QUIC_PROTOCOL_H_ | 6 #define NET_QUIC_QUIC_PROTOCOL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> |
9 #include <limits> | 10 #include <limits> |
10 #include <list> | 11 #include <list> |
11 #include <map> | 12 #include <map> |
12 #include <ostream> | 13 #include <ostream> |
13 #include <set> | 14 #include <set> |
14 #include <string> | 15 #include <string> |
15 #include <utility> | 16 #include <utility> |
16 #include <vector> | 17 #include <vector> |
17 | 18 |
18 #include "base/basictypes.h" | 19 #include "base/basictypes.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // 16 bits (little-endian byte order) are split into exponent (high 5) and | 163 // 16 bits (little-endian byte order) are split into exponent (high 5) and |
163 // mantissa (low 11) and decoded as: | 164 // mantissa (low 11) and decoded as: |
164 // uint64 value; | 165 // uint64 value; |
165 // if (exponent == 0) value = mantissa; | 166 // if (exponent == 0) value = mantissa; |
166 // else value = (mantissa | 1 << 11) << (exponent - 1) | 167 // else value = (mantissa | 1 << 11) << (exponent - 1) |
167 const int kUFloat16ExponentBits = 5; | 168 const int kUFloat16ExponentBits = 5; |
168 const int kUFloat16MaxExponent = (1 << kUFloat16ExponentBits) - 2; // 30 | 169 const int kUFloat16MaxExponent = (1 << kUFloat16ExponentBits) - 2; // 30 |
169 const int kUFloat16MantissaBits = 16 - kUFloat16ExponentBits; // 11 | 170 const int kUFloat16MantissaBits = 16 - kUFloat16ExponentBits; // 11 |
170 const int kUFloat16MantissaEffectiveBits = kUFloat16MantissaBits + 1; // 12 | 171 const int kUFloat16MantissaEffectiveBits = kUFloat16MantissaBits + 1; // 12 |
171 const uint64 kUFloat16MaxValue = // 0x3FFC0000000 | 172 const uint64 kUFloat16MaxValue = // 0x3FFC0000000 |
172 ((GG_UINT64_C(1) << kUFloat16MantissaEffectiveBits) - 1) << | 173 ((UINT64_C(1) << kUFloat16MantissaEffectiveBits) - 1) << |
173 kUFloat16MaxExponent; | 174 kUFloat16MaxExponent; |
174 | 175 |
175 enum TransmissionType { | 176 enum TransmissionType { |
176 NOT_RETRANSMISSION, | 177 NOT_RETRANSMISSION, |
177 FIRST_TRANSMISSION_TYPE = NOT_RETRANSMISSION, | 178 FIRST_TRANSMISSION_TYPE = NOT_RETRANSMISSION, |
178 HANDSHAKE_RETRANSMISSION, // Retransmits due to handshake timeouts. | 179 HANDSHAKE_RETRANSMISSION, // Retransmits due to handshake timeouts. |
179 ALL_UNACKED_RETRANSMISSION, // Retransmits all unacked packets. | 180 ALL_UNACKED_RETRANSMISSION, // Retransmits all unacked packets. |
180 ALL_INITIAL_RETRANSMISSION, // Retransmits all initially encrypted packets. | 181 ALL_INITIAL_RETRANSMISSION, // Retransmits all initially encrypted packets. |
181 LOSS_RETRANSMISSION, // Retransmits due to loss detection. | 182 LOSS_RETRANSMISSION, // Retransmits due to loss detection. |
182 RTO_RETRANSMISSION, // Retransmits due to retransmit time out. | 183 RTO_RETRANSMISSION, // Retransmits due to retransmit time out. |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 bool in_flight; | 1059 bool in_flight; |
1059 // True if the packet can never be acked, so it can be removed. | 1060 // True if the packet can never be acked, so it can be removed. |
1060 bool is_unackable; | 1061 bool is_unackable; |
1061 // True if the packet is an FEC packet. | 1062 // True if the packet is an FEC packet. |
1062 bool is_fec_packet; | 1063 bool is_fec_packet; |
1063 }; | 1064 }; |
1064 | 1065 |
1065 } // namespace net | 1066 } // namespace net |
1066 | 1067 |
1067 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1068 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
OLD | NEW |