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

Unified Diff: net/quic/core/quic_packet_creator.h

Issue 2828543002: Let QUIC be able to add random padding of [1,256] bytes after fin is consumed for a stream. Random … (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/quic_constants.h ('k') | net/quic/core/quic_packet_creator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_packet_creator.h
diff --git a/net/quic/core/quic_packet_creator.h b/net/quic/core/quic_packet_creator.h
index 68b70d42ff42370e08288bcf3bd90c05bc49039b..33b81d25f2ba368ca8067637c44e97cdd0d698a1 100644
--- a/net/quic/core/quic_packet_creator.h
+++ b/net/quic/core/quic_packet_creator.h
@@ -202,6 +202,10 @@ class QUIC_EXPORT_PRIVATE QuicPacketCreator {
// Sets the maximum packet length.
void SetMaxPacketLength(QuicByteCount length);
+ // Increases pending_padding_bytes by |size|. Pending padding will be sent by
+ // MaybeAddPadding().
+ void AddPendingPadding(QuicByteCount size);
+
void set_debug_delegate(DebugDelegate* debug_delegate) {
debug_delegate_ = debug_delegate;
}
@@ -210,6 +214,8 @@ class QUIC_EXPORT_PRIVATE QuicPacketCreator {
return latched_flag_no_stop_waiting_frames_;
}
+ QuicByteCount pending_padding_bytes() const { return pending_padding_bytes_; }
+
private:
friend class test::QuicPacketCreatorPeer;
@@ -242,9 +248,8 @@ class QUIC_EXPORT_PRIVATE QuicPacketCreator {
// saves the |frame| in the next SerializedPacket.
bool AddFrame(const QuicFrame& frame, bool save_retransmittable_frames);
- // Adds a padding frame to the current packet only if the current packet
- // contains a handshake message, and there is sufficient room to fit a
- // padding frame.
+ // Adds a padding frame to the current packet (if there is space) when (1)
+ // current packet needs full padding or (2) there are pending paddings.
void MaybeAddPadding();
// Serializes all frames which have been added and adds any which should be
@@ -303,6 +308,16 @@ class QUIC_EXPORT_PRIVATE QuicPacketCreator {
// The latched value of FLAGS_quic_reloadable_flag_quic_no_stop_waiting_frames
bool latched_flag_no_stop_waiting_frames_;
+ // Pending padding bytes to send. Pending padding bytes will be sent in next
+ // packet(s) (after all other frames) if current constructed packet does not
+ // have room to send all of them.
+ QuicByteCount pending_padding_bytes_;
+
+ // Indicates whether current constructed packet needs full padding to max
+ // packet size. Please note, full padding does not consume pending padding
+ // bytes.
+ bool needs_full_padding_;
+
DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator);
};
« no previous file with comments | « net/quic/core/quic_constants.h ('k') | net/quic/core/quic_packet_creator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698