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

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

Issue 2825083003: Landing Recent QUIC changes until Mon Apr 17 2017 (Closed)
Patch Set: Format 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_packet_creator_test.cc ('k') | net/quic/core/quic_packet_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « net/quic/core/quic_packet_creator_test.cc ('k') | net/quic/core/quic_packet_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698