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

Unified Diff: net/quic/quic_packet_generator.h

Issue 1459343009: Make QuicPacketCreator be able to serialize packet itself when it does not have room for next strea… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@107733506
Patch Set: Created 5 years, 1 month 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
Index: net/quic/quic_packet_generator.h
diff --git a/net/quic/quic_packet_generator.h b/net/quic/quic_packet_generator.h
index 07ace040f3db7723a0c4f9edfba74404cab20772..ff181f0241c36bd4ebb0b0f26476f165e11a66c7 100644
--- a/net/quic/quic_packet_generator.h
+++ b/net/quic/quic_packet_generator.h
@@ -65,7 +65,8 @@ namespace test {
class QuicPacketGeneratorPeer;
} // namespace test
-class NET_EXPORT_PRIVATE QuicPacketGenerator {
+class NET_EXPORT_PRIVATE QuicPacketGenerator
+ : public QuicPacketCreator::DelegateInterface {
public:
class NET_EXPORT_PRIVATE DelegateInterface {
public:
@@ -98,7 +99,7 @@ class NET_EXPORT_PRIVATE QuicPacketGenerator {
QuicRandom* random_generator,
DelegateInterface* delegate);
- virtual ~QuicPacketGenerator();
+ ~QuicPacketGenerator() override;
// Called by the connection in the event of the congestion window changing.
void OnCongestionWindowChange(QuicPacketCount max_packets_in_flight);
@@ -183,6 +184,9 @@ class NET_EXPORT_PRIVATE QuicPacketGenerator {
// Sets the encrypter to use for the encryption level.
void SetEncrypter(EncryptionLevel level, QuicEncrypter* encrypter);
+ // QuicPacketCreator::DelegateInterface.
+ void OnSerializedPacket(SerializedPacket* serialized_packet) override;
+
// Sets the encryption level that will be applied to new packets.
void set_encryption_level(EncryptionLevel level);
@@ -256,14 +260,15 @@ class NET_EXPORT_PRIVATE QuicPacketGenerator {
// retransmittable) would still allow the resulting packet to be sent now.
bool CanSendWithNextPendingFrameAddition() const;
// Add exactly one pending frame, preferring ack frames over control frames.
+ // Returns true if a pending frame is successfully added.
+ // Returns false and flushes current open packet if the pending frame cannot
+ // fit into current open packet.
bool AddNextPendingFrame();
// Adds a frame and takes ownership of the underlying buffer.
bool AddFrame(const QuicFrame& frame,
UniqueStreamBuffer buffer,
bool needs_padding);
- void SerializeAndSendPacket();
-
DelegateInterface* delegate_;
DebugDelegate* debug_delegate_;

Powered by Google App Engine
This is Rietveld 408576698