| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 virtual bool IsFinished() const = 0; | 43 virtual bool IsFinished() const = 0; |
| 44 | 44 |
| 45 // Revives the missing packet from this FEC group. This may return a packet | 45 // Revives the missing packet from this FEC group. This may return a packet |
| 46 // that is null padded to a greater length than the original packet, but | 46 // that is null padded to a greater length than the original packet, but |
| 47 // the framer will handle it correctly. Returns the length of the data | 47 // the framer will handle it correctly. Returns the length of the data |
| 48 // written to |decrypted_payload|, or 0 if the packet could not be revived. | 48 // written to |decrypted_payload|, or 0 if the packet could not be revived. |
| 49 virtual size_t Revive(QuicPacketHeader* header, | 49 virtual size_t Revive(QuicPacketHeader* header, |
| 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 of this FEC group protects any packets with sequence | 53 // Returns true if the group is waiting for any packets with sequence numbers |
| 54 // numbers less than |num|. | 54 // less than |num|. |
| 55 virtual bool ProtectsPacketsBefore(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. | 60 // The FEC group number to be used on the FEC packet. |
| 61 virtual QuicPacketNumber MinProtectedPacket() const = 0; | 61 virtual QuicPacketNumber MinProtectedPacket() const = 0; |
| 62 | 62 |
| 63 // Number of packets in the group. | 63 // Number of packets in the group. |
| 64 virtual QuicPacketCount NumReceivedPackets() const = 0; | 64 virtual QuicPacketCount NumReceivedPackets() const = 0; |
| 65 | 65 |
| 66 // Returns the effective encryption level of the FEC group. | 66 // Returns the effective encryption level of the FEC group. |
| 67 virtual EncryptionLevel EffectiveEncryptionLevel() const = 0; | 67 virtual EncryptionLevel EffectiveEncryptionLevel() const = 0; |
| 68 | 68 |
| 69 // An optimized version of running |output| ^= |input|, where ^ is | 69 // 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|. | 70 // 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); | 71 static void XorBuffers(const char* input, size_t size_in_bytes, char* output); |
| 72 | 72 |
| 73 protected: | 73 protected: |
| 74 QuicFecGroupInterface() {} | 74 QuicFecGroupInterface() {} |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 DISALLOW_COPY_AND_ASSIGN(QuicFecGroupInterface); | 77 DISALLOW_COPY_AND_ASSIGN(QuicFecGroupInterface); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace net | 80 } // namespace net |
| 81 | 81 |
| 82 #endif // NET_QUIC_QUIC_FEC_GROUP_INTERFACE_H_ | 82 #endif // NET_QUIC_QUIC_FEC_GROUP_INTERFACE_H_ |
| OLD | NEW |