Land Recent QUIC Changes.
Removed QUIC_VERSION_19 from kSupportedQuicVersions. Will
submit a separate CL after making sure all tests pass with
QUIC_VERSION_19.
Introduces QUIC_VERSION_19, connection level flow control.
QuicConnection now has its own flow_controller_ which aggregates bytes
sent/received/consumed from all the streams on a given connection.
WINDOW_UPDATE and BLOCKED frames are sent with a stream_id of 0 when
they refer to the connection.
On receipt of a WINDOW_UPDATE which unblocks the connection level flow
control, all blocked streams are given a chance to write through a call
to OnCanWrite.
QUIC_VERSION_19: connection flow control. Protected behind
--FLAGS_enable_quic_connection_flow_control
Merge internal change: 66020935
https://codereview.chromium.org/265953003/
New QUIC SendAlgorithmInterface which replaces OnPacketAcked,
OnPacketLost, OnPacketAbandoned, and OnRttUpdated with a single
OnCongestionEvent method.
Merge internal change: 66018835
https://codereview.chromium.org/264743011/
Move TransmissionInfo from QuicUnackedPacketMap to QuicProtocol and add
a simple bytes_in_flight accessor.
Merge internal change: 65886839
https://codereview.chromium.org/265993003/
If stream N is added to the write blocked list, and later a
WINDOW_UPDATE frame arrives for the same stream, then stream N will
added for a second time to the write blocked list.
This is wrong - a stream should only be on the write blocked list once.
The write blocked list is implemented as a deque. This CL adds a
parallel set<QuicStreamId> which also keeps track of blocked streams,
but allows more efficient membership testing. This is used to ensure no
duplicate stream IDs end up in the write blocked list.
Don't allow duplicate IDs in QUIC write blocked list.
Merge internal change: 65878293
https://codereview.chromium.org/261983003/
Sync'ing changes with internal source tree. Minor formatting changes.
Merge internal change: 65851919
https://codereview.chromium.org/265813010/
Test-only change to clean up QuicSentPacketManagerTest in order to make
changing the SendAlgorithmInterface easier.
Merge internal change: 65816291
https://codereview.chromium.org/268623010/
[email protected]
Review URL: https://codereview.chromium.org/265833015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268980 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/net/quic/quic_sent_packet_manager.h b/net/quic/quic_sent_packet_manager.h
index 4530349b9..fd01eee 100644
--- a/net/quic/quic_sent_packet_manager.h
+++ b/net/quic/quic_sent_packet_manager.h
@@ -170,11 +170,6 @@
friend class test::QuicConnectionPeer;
friend class test::QuicSentPacketManagerPeer;
- enum ReceivedByPeer {
- RECEIVED_BY_PEER,
- NOT_RECEIVED_BY_PEER,
- };
-
// The retransmission timer is a single timer which switches modes depending
// upon connection state.
enum RetransmissionTimeoutMode {
@@ -195,10 +190,6 @@
// Process the incoming ack looking for newly ack'd data packets.
void HandleAckForSentPackets(const ReceivedPacketInfo& received_info);
- // Called when a packet is timed out, such as an RTO. Removes the bytes from
- // the congestion manager, but does not change the congestion window size.
- void OnPacketAbandoned(QuicPacketSequenceNumber sequence_number);
-
// Returns the current retransmission mode.
RetransmissionTimeoutMode GetRetransmissionMode() const;
@@ -221,7 +212,8 @@
const QuicTime::Delta GetRetransmissionDelay() const;
// Update the RTT if the ack is for the largest acked sequence number.
- void MaybeUpdateRTT(const ReceivedPacketInfo& received_info,
+ // Returns true if the rtt was updated.
+ bool MaybeUpdateRTT(const ReceivedPacketInfo& received_info,
const QuicTime& ack_receive_time);
// Chooses whether to nack retransmit any packets based on the receipt info.
@@ -233,6 +225,13 @@
// necessary.
void InvokeLossDetection(QuicTime time);
+ // Invokes OnCongestionEvent if |rtt_updated| is true, there are pending acks,
+ // or pending losses. Clears pending acks and pending losses afterwards.
+ // |bytes_in_flight| is the number of bytes in flight before the losses or
+ // acks.
+ void MaybeInvokeCongestionEvent(bool rtt_updated,
+ QuicByteCount bytes_in_flight);
+
// Marks |sequence_number| as having been revived by the peer, but not
// received, so the packet remains pending if it is and the congestion control
// does not consider the packet acked.
@@ -244,8 +243,7 @@
// iterator to the next remaining unacked packet.
QuicUnackedPacketMap::const_iterator MarkPacketHandled(
QuicPacketSequenceNumber sequence_number,
- QuicTime::Delta delta_largest_observed,
- ReceivedByPeer received_by_peer);
+ QuicTime::Delta delta_largest_observed);
// Request that |sequence_number| be retransmitted after the other pending
// retransmissions. Does not add it to the retransmissions if it's already
@@ -291,6 +289,10 @@
size_t max_tail_loss_probes_;
bool using_pacing_;
+ // Sets of packets acked and lost as a result of the last congestion event.
+ SendAlgorithmInterface::CongestionMap packets_acked_;
+ SendAlgorithmInterface::CongestionMap packets_lost_;
+
DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager);
};