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

Unified Diff: net/quic/quic_packet_generator.h

Issue 329933003: Refactor the Connection and Generator so the Creator is completely (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/quic_packet_creator_test.cc ('k') | net/quic/quic_packet_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_packet_generator.h
diff --git a/net/quic/quic_packet_generator.h b/net/quic/quic_packet_generator.h
index e5b8de4d3fc97d8bcf84017607cfb31e9749c6d0..d408aeab31b4eded5ebb60b4c6c54f88feda0ed4 100644
--- a/net/quic/quic_packet_generator.h
+++ b/net/quic/quic_packet_generator.h
@@ -91,9 +91,10 @@ class NET_EXPORT_PRIVATE QuicPacketGenerator {
virtual void OnFrameAddedToPacket(const QuicFrame& frame) {}
};
- QuicPacketGenerator(DelegateInterface* delegate,
- DebugDelegate* debug_delegate,
- QuicPacketCreator* creator);
+ QuicPacketGenerator(QuicConnectionId connection_id,
+ QuicFramer* framer,
+ QuicRandom* random_generator,
+ DelegateInterface* delegate);
virtual ~QuicPacketGenerator();
@@ -137,6 +138,42 @@ class NET_EXPORT_PRIVATE QuicPacketGenerator {
bool HasQueuedFrames() const;
+ // Makes the framer not serialize the protocol version in sent packets.
+ void StopSendingVersion();
+
+ // Creates a version negotiation packet which supports |supported_versions|.
+ // Caller owns the created packet. Also, sets the entropy hash of the
+ // serialized packet to a random bool and returns that value as a member of
+ // SerializedPacket.
+ QuicEncryptedPacket* SerializeVersionNegotiationPacket(
+ const QuicVersionVector& supported_versions);
+
+
+ // Re-serializes frames with the original packet's sequence number length.
+ // Used for retransmitting packets to ensure they aren't too long.
+ // Caller must ensure that any open FEC group is closed before calling this
+ // method.
+ SerializedPacket ReserializeAllFrames(
+ const QuicFrames& frames,
+ QuicSequenceNumberLength original_length);
+
+ // Update the sequence number length to use in future packets as soon as it
+ // can be safely changed.
+ void UpdateSequenceNumberLength(
+ QuicPacketSequenceNumber least_packet_awaited_by_peer,
+ QuicByteCount congestion_window);
+
+ // Sets the encryption level that will be applied to new packets.
+ void set_encryption_level(EncryptionLevel level);
+
+ // Sequence number of the last created packet, or 0 if no packets have been
+ // created.
+ QuicPacketSequenceNumber sequence_number() const;
+
+ size_t max_packet_length() const;
+
+ void set_max_packet_length(size_t length);
+
void set_debug_delegate(DebugDelegate* debug_delegate) {
debug_delegate_ = debug_delegate;
}
@@ -176,7 +213,7 @@ class NET_EXPORT_PRIVATE QuicPacketGenerator {
DelegateInterface* delegate_;
DebugDelegate* debug_delegate_;
- QuicPacketCreator* packet_creator_;
+ QuicPacketCreator packet_creator_;
QuicFrames queued_control_frames_;
// True if batch mode is currently enabled.
« no previous file with comments | « net/quic/quic_packet_creator_test.cc ('k') | net/quic/quic_packet_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698