summaryrefslogtreecommitdiffstats
path: root/net/quic/quic_packet_generator.h
diff options
context:
space:
mode:
authorrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-13 07:41:59 +0000
committerrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-13 07:41:59 +0000
commitbbb1007532bda442f71c6729d2369a2cab2ea36f (patch)
tree19bc79b07bec1164fc37398ec5d8303f1e607f2c /net/quic/quic_packet_generator.h
parentbd3093c384c18a559e4449512a85d54d714b1d32 (diff)
downloadchromium_src-bbb1007532bda442f71c6729d2369a2cab2ea36f.zip
chromium_src-bbb1007532bda442f71c6729d2369a2cab2ea36f.tar.gz
chromium_src-bbb1007532bda442f71c6729d2369a2cab2ea36f.tar.bz2
Land Recent QUIC Changes.
Fix RttStats windowing so if no recent min rtt window is specified, recent_min_rtt is the same as min_rtt. recent_min_rtt is only used within BBR. Merge internal change: 69034369 https://codereview.chromium.org/337433002/ Close QUIC connection with correct flow control error code, added a test for this, and tidyup of a couple of other tests. Close QUIC connection with correct flow control error code. Merge internal change: 69012148 https://codereview.chromium.org/327393004/ Sync'ing DefaultRandom code with internal code. Merge internal change: 69007888 https://codereview.chromium.org/335553002/ Fix some clang_tidy warnings in quic_connection_test. Merge internal change: 69001838 https://codereview.chromium.org/335543002/ Refactor the Connection and Generator so the Creator is completely encapsulated by the Generator. Merge internal change: 69000832 https://codereview.chromium.org/329933003/ API changes to Write path Session on down for FEC protection. Added |fec_protection| flag to data writes to QuicSession and subclasses, down to QuicConnection and QuicPacketGenerator. This flag is used by the packet generator to turn on FEC protection for the flagged data. Merge internal change: 68993204 https://codereview.chromium.org/335533002/ Wrap all tag printing in TagToString Merge internal change: 68862495 https://codereview.chromium.org/332523005/ QuicStreamSequencer closes the connection on receipt of frames overlapping with buffered data. Merge internal change: 68858381 https://codereview.chromium.org/334603002/ Fixed lint errors: At least two spaces is best between code and comments Merge internal change: 68847097 https://codereview.chromium.org/334583002/ R=rch@chromium.org Review URL: https://codereview.chromium.org/331573002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276964 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/quic/quic_packet_generator.h')
-rw-r--r--net/quic/quic_packet_generator.h57
1 files changed, 44 insertions, 13 deletions
diff --git a/net/quic/quic_packet_generator.h b/net/quic/quic_packet_generator.h
index e9c773b..d408aeab 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();
@@ -122,6 +123,7 @@ class NET_EXPORT_PRIVATE QuicPacketGenerator {
const IOVector& data,
QuicStreamOffset offset,
bool fin,
+ FecProtection fec_protection,
QuicAckNotifier* notifier);
// Indicates whether batch mode is currently enabled.
@@ -136,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;
}
@@ -150,14 +188,6 @@ class NET_EXPORT_PRIVATE QuicPacketGenerator {
// creator, in which case, only the generator's state is altered.
void MaybeStartFecProtection();
- // Turn off FEC protection for subsequent packets. If |force| is true,
- // force-closes any open FEC group, sends out an FEC packet if one was under
- // construction, and turns off protection in the generator and creator. If
- // |force| is false, does the same as above if the creator is ready to send
- // and FEC packet. Note that when |force| is false, the creator may still have
- // an open FEC group after this method runs.
- void MaybeStopFecProtection(bool force);
-
// Serializes and calls the delegate on an FEC packet if one was under
// construction in the creator. When |force| is false, it relies on the
// creator being ready to send an FEC packet, otherwise FEC packet is sent
@@ -183,13 +213,14 @@ 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.
bool batch_mode_;
- // True if FEC protection is on.
+ // True if FEC protection is on. The creator may have an open FEC group even
+ // if this variable is false.
bool should_fec_protect_;
// Flags to indicate the need for just-in-time construction of a frame.