| 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 // Tracks information about an FEC group, including the packets | 5 // Tracks information about an FEC group, including the packets |
| 6 // that have been seen, and the running parity. Provides the ability | 6 // that have been seen, and the running parity. Provides the ability |
| 7 // to revive a dropped packet. | 7 // to revive a dropped packet. |
| 8 | 8 |
| 9 #ifndef NET_QUIC_QUIC_FEC_GROUP_INTERFACE_H_ | 9 #ifndef NET_QUIC_QUIC_FEC_GROUP_INTERFACE_H_ |
| 10 #define NET_QUIC_QUIC_FEC_GROUP_INTERFACE_H_ | 10 #define NET_QUIC_QUIC_FEC_GROUP_INTERFACE_H_ |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 char* decrypted_payload, | 50 char* decrypted_payload, |
| 51 size_t decrypted_payload_len) = 0; | 51 size_t decrypted_payload_len) = 0; |
| 52 | 52 |
| 53 // Returns true if the group is waiting for any packets with sequence numbers | 53 // Returns true if the group is waiting for any packets with sequence numbers |
| 54 // less than |num|. | 54 // less than |num|. |
| 55 virtual bool IsWaitingForPacketBefore(QuicPacketNumber num) const = 0; | 55 virtual bool IsWaitingForPacketBefore(QuicPacketNumber num) const = 0; |
| 56 | 56 |
| 57 // The FEC data in the FEC packet. | 57 // The FEC data in the FEC packet. |
| 58 virtual const base::StringPiece PayloadParity() const = 0; | 58 virtual const base::StringPiece PayloadParity() const = 0; |
| 59 | 59 |
| 60 // The FEC group number to be used on the FEC packet. | |
| 61 virtual QuicPacketNumber MinProtectedPacket() const = 0; | |
| 62 | |
| 63 // Number of packets in the group. | 60 // Number of packets in the group. |
| 64 virtual QuicPacketCount NumReceivedPackets() const = 0; | 61 virtual QuicPacketCount NumReceivedPackets() const = 0; |
| 65 | 62 |
| 66 // Returns the effective encryption level of the FEC group. | 63 // Returns the effective encryption level of the FEC group. |
| 67 virtual EncryptionLevel EffectiveEncryptionLevel() const = 0; | 64 virtual EncryptionLevel EffectiveEncryptionLevel() const = 0; |
| 68 | 65 |
| 69 // An optimized version of running |output| ^= |input|, where ^ is | 66 // An optimized version of running |output| ^= |input|, where ^ is |
| 70 // byte-by-byte XOR and both |output| and |input| are of size |size_in_bytes|. | 67 // byte-by-byte XOR and both |output| and |input| are of size |size_in_bytes|. |
| 71 static void XorBuffers(const char* input, size_t size_in_bytes, char* output); | 68 static void XorBuffers(const char* input, size_t size_in_bytes, char* output); |
| 72 | 69 |
| 73 protected: | 70 protected: |
| 74 QuicFecGroupInterface() {} | 71 QuicFecGroupInterface() {} |
| 75 | 72 |
| 76 private: | 73 private: |
| 77 DISALLOW_COPY_AND_ASSIGN(QuicFecGroupInterface); | 74 DISALLOW_COPY_AND_ASSIGN(QuicFecGroupInterface); |
| 78 }; | 75 }; |
| 79 | 76 |
| 80 } // namespace net | 77 } // namespace net |
| 81 | 78 |
| 82 #endif // NET_QUIC_QUIC_FEC_GROUP_INTERFACE_H_ | 79 #endif // NET_QUIC_QUIC_FEC_GROUP_INTERFACE_H_ |
| OLD | NEW |