Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: net/quic/quic_fec_group.h

Issue 2011653004: Remove obsolete fields in quic_protocol and their current usage in QUIC. Reorders QuicAckFrame fie… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@122721477
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_connection_test.cc ('k') | net/quic/quic_fec_group.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4 //
5 // Tracks information about an FEC group, including the packets
6 // that have been seen, and the running parity. Provides the ability
7 // to revive a dropped packet.
8
9 #ifndef NET_QUIC_QUIC_FEC_GROUP_H_
10 #define NET_QUIC_QUIC_FEC_GROUP_H_
11
12 #include <cstddef>
13
14 #include "base/macros.h"
15 #include "base/strings/string_piece.h"
16 #include "net/quic/quic_fec_group_interface.h"
17 #include "net/quic/quic_protocol.h"
18
19 namespace net {
20
21 class NET_EXPORT_PRIVATE QuicFecGroup : public QuicFecGroupInterface {
22 public:
23 explicit QuicFecGroup(QuicPacketNumber fec_group_number);
24 virtual ~QuicFecGroup();
25
26 // Implementation of QuicFecGroupInterface.
27 bool Update(EncryptionLevel encryption_level,
28 const QuicPacketHeader& header,
29 base::StringPiece decrypted_payload) override;
30 bool UpdateFec(EncryptionLevel encryption_level,
31 const QuicPacketHeader& header,
32 base::StringPiece redundancy) override;
33 bool CanRevive() const override;
34 bool IsFinished() const override;
35 size_t Revive(QuicPacketHeader* header,
36 char* decrypted_payload,
37 size_t decrypted_payload_len) override;
38 bool IsWaitingForPacketBefore(QuicPacketNumber num) const override;
39 const base::StringPiece PayloadParity() const override;
40 QuicPacketCount NumReceivedPackets() const override;
41 EncryptionLevel EffectiveEncryptionLevel() const override;
42 QuicFecGroupNumber FecGroupNumber() const override;
43
44 private:
45 bool UpdateParity(base::StringPiece payload);
46 // Returns the number of missing packets, or QuicPacketCount max
47 // if the number of missing packets is not known.
48 QuicPacketCount NumMissingPackets() const;
49
50 bool has_received_fec_packet() const {
51 return max_protected_packet_ != kInvalidPacketNumber;
52 }
53
54 // Set of packets that we have recevied.
55 PacketNumberSet received_packets_;
56 // packet number of the first protected packet in this group (the one
57 // with the lowest packet number). Will only be set once the FEC
58 // packet has been seen.
59 const QuicPacketNumber min_protected_packet_;
60 // packet number of the last protected packet in this group (the one
61 // with the highest packet number). Will only be set once the FEC
62 // packet has been seen.
63 QuicPacketNumber max_protected_packet_;
64 // The cumulative parity calculation of all received packets.
65 char payload_parity_[kMaxPacketSize];
66 size_t payload_parity_len_;
67 // The effective encryption level, which is the lowest encryption level of
68 // the data and FEC in the group.
69 EncryptionLevel effective_encryption_level_;
70
71 DISALLOW_COPY_AND_ASSIGN(QuicFecGroup);
72 };
73
74 } // namespace net
75
76 #endif // NET_QUIC_QUIC_FEC_GROUP_H_
OLDNEW
« no previous file with comments | « net/quic/quic_connection_test.cc ('k') | net/quic/quic_fec_group.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698