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

Unified Diff: net/quic/quic_packet_creator.h

Issue 1495263002: QuicPacketCreator knows when to start FEC protection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@108738647
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/quic/quic_packet_creator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_packet_creator.h
diff --git a/net/quic/quic_packet_creator.h b/net/quic/quic_packet_creator.h
index 8ac24611ef66c4dad88af00c957e3c3b09c42e16..7b33ed5b4135f1e704b99106f9e785536c98d2ba 100644
--- a/net/quic/quic_packet_creator.h
+++ b/net/quic/quic_packet_creator.h
@@ -52,14 +52,11 @@ class NET_EXPORT_PRIVATE QuicPacketCreator {
// return true if an FEC group is open.
bool ShouldSendFec(bool force_close) const;
- // Turn on FEC protection for subsequent packets. If no FEC group is currently
- // open, this method flushes current open packet and then turns FEC on.
- void MaybeStartFecProtection();
-
// If ShouldSendFec returns true, serializes currently constructed FEC packet
// and calls the delegate on the packet. Resets current FEC group if FEC
// protection policy is FEC_ALARM_TRIGGER but |is_fec_timeout| is false.
- // Also tries to turn off FEC protection if should_fec_protect_ is false.
+ // Also tries to turn off FEC protection if should_fec_protect_next_packet is
+ // false.
void MaybeSendFecPacketAndCloseGroup(bool force_send_fec,
bool is_fec_timeout);
@@ -93,13 +90,15 @@ class NET_EXPORT_PRIVATE QuicPacketCreator {
// If current packet is not full, converts a raw payload into a stream frame
// that fits into the open packet and adds it to the packet.
// The payload begins at |iov_offset| into the |iov|.
+ // Also tries to start FEC protection depends on |fec_protection|.
bool ConsumeData(QuicStreamId id,
QuicIOVector iov,
size_t iov_offset,
QuicStreamOffset offset,
bool fin,
bool needs_padding,
- QuicFrame* frame);
+ QuicFrame* frame,
+ FecProtection fec_protection);
// Returns true if current open packet can accommodate more stream frames of
// stream |id| at |offset|, false otherwise.
@@ -238,10 +237,12 @@ class NET_EXPORT_PRIVATE QuicPacketCreator {
rtt_multiplier_for_fec_timeout_ = rtt_multiplier_for_fec_timeout;
}
- bool should_fec_protect() { return should_fec_protect_; }
+ bool should_fec_protect_next_packet() {
+ return should_fec_protect_next_packet_;
+ }
- void set_should_fec_protect(bool should_fec_protect) {
- should_fec_protect_ = should_fec_protect;
+ void set_should_fec_protect_next_packet(bool should_fec_protect_next_packet) {
+ should_fec_protect_next_packet_ = should_fec_protect_next_packet;
}
private:
@@ -307,6 +308,10 @@ class NET_EXPORT_PRIVATE QuicPacketCreator {
// Fails if |buffer_len| isn't long enough for the encrypted packet.
SerializedPacket SerializePacket(char* encrypted_buffer, size_t buffer_len);
+ // Turn on FEC protection for subsequent packets. If no FEC group is currently
+ // open, this method flushes current open packet and then turns FEC on.
+ void MaybeStartFecProtection();
+
// Turn on FEC protection for subsequently created packets. FEC should be
// enabled first (max_packets_per_fec_group should be non-zero) for FEC
// protection to start.
@@ -336,12 +341,13 @@ class NET_EXPORT_PRIVATE QuicPacketCreator {
scoped_ptr<QuicRandomBoolSource> random_bool_source_;
QuicPacketNumber packet_number_;
// True when creator is requested to turn on FEC protection. False otherwise.
- // There could be a time difference between should_fec_protect_ is true/false
- // and FEC is actually turned on/off (e.g., The creator may have an open FEC
- // group even if this variable is false).
- bool should_fec_protect_;
+ // There is a time difference between should_fec_protect_next_packet is
+ // true/false and FEC is actually turned on/off (e.g., The creator may have an
+ // open FEC group even if this variable is false).
+ bool should_fec_protect_next_packet_;
// If true, any created packets will be FEC protected.
- // TODO(fayang): Combine should_fec_protect_ and fec_protect_ to one variable.
+ // TODO(fayang): Combine should_fec_protect_next_packet and fec_protect_ to
+ // one variable.
bool fec_protect_;
scoped_ptr<QuicFecGroup> fec_group_;
// Controls whether protocol version should be included while serializing the
« no previous file with comments | « no previous file | net/quic/quic_packet_creator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698