summaryrefslogtreecommitdiffstats
path: root/net/quic/quic_fec_group.h
diff options
context:
space:
mode:
authorrtenneti <rtenneti@chromium.org>2015-10-19 23:14:20 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-20 06:15:11 +0000
commit1535e3a3936db1c0a2a410fd12ac9c5b920ad1ac (patch)
treebb61063a62323a60ac2da98c4c4807f1071a9a4b /net/quic/quic_fec_group.h
parent271e821edda950d1f54af8bc3d6d8217ddfb0427 (diff)
downloadchromium_src-1535e3a3936db1c0a2a410fd12ac9c5b920ad1ac.zip
chromium_src-1535e3a3936db1c0a2a410fd12ac9c5b920ad1ac.tar.gz
chromium_src-1535e3a3936db1c0a2a410fd12ac9c5b920ad1ac.tar.bz2
Landing Recent QUIC changes until 10/11/2015 18:20 UTC
relnote: Split QuicFecGroup interface into QuicFecGroupInterface. Should cause no behavior change. Implementing 'sliding window' FEC, part 1a. Merge internal change: 105168235 https://codereview.chromium.org/1410593004/ relnote: n/a (no changes to binary). Cleanup changes to tests, comments, and formatting. Merge internal change: 105084706 https://codereview.chromium.org/1418493004/ relnote: Reorganize how the read side of QUIC connections is closed down when the consumer doesn't want any more data. Flag protected by FLAG_quic_implement_stop_reading; default true. Remove CloseReadSide from the subclass interface provided by ReliableQuicStream. Subclasses (in particular QuicDataStream and ...QuicServerStream) now have an internal StopReading method which causes all further incoming data to be ignored in the subclass code. This prevents the stream object from being deleted until the stream is properly closed. It is necessary to keep the stream object functioning until a FIN or RST_STREAM is received in order to send flow-control window updates for the stream. (When we define the RST_STREAM/NO_ERROR mechanism to tell the peer to abort sending more data we will send RST_STREAM/NO_ERROR as soon as this consumer is done writing as well.) Re-install QuicSpdyServerStream::kErrorResponseBody as it is now used in two places. FIXED=21369841 Merge internal change: 105079850 https://codereview.chromium.org/1415603003/ relnote: n/a (test change only). Call SetSpdyStreamCreator on the test server before starting its thread, to avoid a data race. Merge internal change: 104964040 https://codereview.chromium.org/1415783002/ relnote: No functional change. Flag protected by default-enabled FLAGS_quic_fix_fin_accounting. Revise processing of incoming stream frames for streams for which reading is closed: Record the FIN bit correctly. This prevents spurious entries in locally_closed_streams_highest_offset_[] and consequent log messages "Surprisingly high number of locally closed streams still waiting for final byte offset". Investigating b/16010251. Merge internal change: 104913996 https://codereview.chromium.org/1418553003/ relnote: minor additions to quic-to-backend (not in production), change fatal log message. Add bidirectional data capability to the QUIC libraries. Add accessors to the peer classes. Merge internal change: 104332818 https://codereview.chromium.org/1417503004/ R=rch@chromium.org Review URL: https://codereview.chromium.org/1414143002 Cr-Commit-Position: refs/heads/master@{#354994}
Diffstat (limited to 'net/quic/quic_fec_group.h')
-rw-r--r--net/quic/quic_fec_group.h66
1 files changed, 15 insertions, 51 deletions
diff --git a/net/quic/quic_fec_group.h b/net/quic/quic_fec_group.h
index 2a1f53f..3afd46c 100644
--- a/net/quic/quic_fec_group.h
+++ b/net/quic/quic_fec_group.h
@@ -3,7 +3,7 @@
// found in the LICENSE file.
//
// Tracks information about an FEC group, including the packets
-// that have been seen, and the running parity. Provided the ability
+// that have been seen, and the running parity. Provides the ability
// to revive a dropped packet.
#ifndef NET_QUIC_QUIC_FEC_GROUP_H_
@@ -12,69 +12,33 @@
#include <cstddef>
#include "base/strings/string_piece.h"
+#include "net/quic/quic_fec_group_interface.h"
#include "net/quic/quic_protocol.h"
namespace net {
-class NET_EXPORT_PRIVATE QuicFecGroup {
+class NET_EXPORT_PRIVATE QuicFecGroup : public QuicFecGroupInterface {
public:
QuicFecGroup();
- ~QuicFecGroup();
+ virtual ~QuicFecGroup();
- // Updates the FEC group based on the delivery of a data packet decrypted at
- // |encryption_level|. Returns false if this packet has already been seen,
- // true otherwise.
+ // Implementation of QuicFecGroupInterface.
bool Update(EncryptionLevel encryption_level,
const QuicPacketHeader& header,
- base::StringPiece decrypted_payload);
-
- // Updates the FEC group based on the delivery of an FEC packet decrypted at
- // |encryption_level|. Returns false if this packet has already been seen or
- // if it does not claim to protect all the packets previously seen in this
- // group.
+ base::StringPiece decrypted_payload) override;
bool UpdateFec(EncryptionLevel encryption_level,
QuicPacketNumber fec_packet_packet_number,
- const QuicFecData& fec);
-
- // Returns true if a packet can be revived from this FEC group.
- bool CanRevive() const;
-
- // Returns true if all packets (FEC and data) from this FEC group have been
- // seen or revived
- bool IsFinished() const;
-
- // Revives the missing packet from this FEC group. This may return a packet
- // that is null padded to a greater length than the original packet, but
- // the framer will handle it correctly. Returns the length of the data
- // written to |decrypted_payload|, or 0 if the packet could not be revived.
+ const QuicFecData& fec) override;
+ bool CanRevive() const override;
+ bool IsFinished() const override;
size_t Revive(QuicPacketHeader* header,
char* decrypted_payload,
- size_t decrypted_payload_len);
-
- // Returns true of this FEC group protects any packets with sequence
- // numbers less than |num|.
- bool ProtectsPacketsBefore(QuicPacketNumber num) const;
-
- const base::StringPiece payload_parity() const {
- return base::StringPiece(payload_parity_, payload_parity_len_);
- }
-
- QuicPacketNumber min_protected_packet() const {
- return min_protected_packet_;
- }
-
- QuicPacketCount NumReceivedPackets() const {
- return received_packets_.size();
- }
-
- // Returns the effective encryption level of the FEC group.
- EncryptionLevel effective_encryption_level() const {
- return effective_encryption_level_;
- }
-
- // An optimized version of running |output| ^= |input|, where ^ is
- // byte-by-byte XOR and both |output| and |input| are of size |size_in_bytes|.
- static void XorBuffers(const char* input, size_t size_in_bytes, char* output);
+ size_t decrypted_payload_len) override;
+ bool ProtectsPacketsBefore(QuicPacketNumber num) const override;
+ const base::StringPiece PayloadParity() const override;
+ QuicPacketNumber MinProtectedPacket() const override;
+ QuicPacketCount NumReceivedPackets() const override;
+ EncryptionLevel EffectiveEncryptionLevel() const override;
private:
bool UpdateParity(base::StringPiece payload);