Index: net/quic/core/quic_packet_generator.h |
diff --git a/net/quic/core/quic_packet_generator.h b/net/quic/core/quic_packet_generator.h |
index 676691c5513bdb38257038d9de448240828e6cc5..bd4604c58c3f37d62fb764d2035152cdc88b8be8 100644 |
--- a/net/quic/core/quic_packet_generator.h |
+++ b/net/quic/core/quic_packet_generator.h |
@@ -73,6 +73,7 @@ class QUIC_EXPORT_PRIVATE QuicPacketGenerator { |
QuicPacketGenerator(QuicConnectionId connection_id, |
QuicFramer* framer, |
+ QuicRandom* random_generator, |
QuicBufferAllocator* buffer_allocator, |
DelegateInterface* delegate); |
@@ -92,11 +93,14 @@ class QUIC_EXPORT_PRIVATE QuicPacketGenerator { |
// mode, these packets will also be sent during this call. |
// |delegate| (if not nullptr) will be informed once all packets sent as a |
// result of this call are ACKed by the peer. |
+ // When |state| is FIN_AND_PADDING, random padding of size [1, 256] will be |
+ // added after stream frames. If current constructed packet cannot |
+ // accommodate, the padding will overflow to the next packet(s). |
QuicConsumedData ConsumeData( |
QuicStreamId id, |
QuicIOVector iov, |
QuicStreamOffset offset, |
- bool fin, |
+ StreamSendingState state, |
QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener); |
// Sends as many data only packets as allowed by the send algorithm and the |
@@ -196,6 +200,13 @@ class QUIC_EXPORT_PRIVATE QuicPacketGenerator { |
// fit into current open packet. |
bool AddNextPendingFrame(); |
+ // Adds a random amount of padding (between 1 to 256 bytes). |
+ void AddRandomPadding(); |
+ |
+ // Sends remaining pending padding. |
+ // Pending paddings should only be sent when there is nothing else to send. |
+ void SendRemainingPendingPadding(); |
+ |
DelegateInterface* delegate_; |
QuicPacketCreator packet_creator_; |
@@ -213,6 +224,8 @@ class QUIC_EXPORT_PRIVATE QuicPacketGenerator { |
// retransmitted. |
QuicStopWaitingFrame pending_stop_waiting_frame_; |
+ QuicRandom* random_generator_; |
+ |
DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); |
}; |