summaryrefslogtreecommitdiffstats
path: root/net/quic/congestion_control/pacing_sender.cc
diff options
context:
space:
mode:
authorrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-07 22:48:48 +0000
committerrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-07 22:48:48 +0000
commit77b5d50b63b575049688c9ef1edb4b5141f7235d (patch)
treeff849af6e3d04c94336daed39e83dee93bf76180 /net/quic/congestion_control/pacing_sender.cc
parent504fca8eaf5f65db2d3766f40be721639a3097f9 (diff)
downloadchromium_src-77b5d50b63b575049688c9ef1edb4b5141f7235d.zip
chromium_src-77b5d50b63b575049688c9ef1edb4b5141f7235d.tar.gz
chromium_src-77b5d50b63b575049688c9ef1edb4b5141f7235d.tar.bz2
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/ R=rch@chromium.org Review URL: https://codereview.chromium.org/265833015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268980 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/quic/congestion_control/pacing_sender.cc')
-rw-r--r--net/quic/congestion_control/pacing_sender.cc37
1 files changed, 14 insertions, 23 deletions
diff --git a/net/quic/congestion_control/pacing_sender.cc b/net/quic/congestion_control/pacing_sender.cc
index fc24afe..5193c75 100644
--- a/net/quic/congestion_control/pacing_sender.cc
+++ b/net/quic/congestion_control/pacing_sender.cc
@@ -12,7 +12,7 @@ PacingSender::PacingSender(SendAlgorithmInterface* sender,
alarm_granularity_(alarm_granularity),
next_packet_send_time_(QuicTime::Zero()),
was_last_send_delayed_(false),
- updated_rtt_(false) {
+ has_valid_rtt_(false) {
}
PacingSender::~PacingSender() {}
@@ -28,15 +28,15 @@ void PacingSender::OnIncomingQuicCongestionFeedbackFrame(
feedback, feedback_receive_time);
}
-void PacingSender::OnPacketAcked(
- QuicPacketSequenceNumber acked_sequence_number,
- QuicByteCount acked_bytes) {
- sender_->OnPacketAcked(acked_sequence_number, acked_bytes);
-}
-
-void PacingSender::OnPacketLost(QuicPacketSequenceNumber sequence_number,
- QuicTime ack_receive_time) {
- sender_->OnPacketLost(sequence_number, ack_receive_time);
+void PacingSender::OnCongestionEvent(bool rtt_updated,
+ QuicByteCount bytes_in_flight,
+ const CongestionMap& acked_packets,
+ const CongestionMap& lost_packets) {
+ if (rtt_updated) {
+ has_valid_rtt_ = true;
+ }
+ sender_->OnCongestionEvent(
+ rtt_updated, bytes_in_flight, acked_packets, lost_packets);
}
bool PacingSender::OnPacketSent(
@@ -45,7 +45,7 @@ bool PacingSender::OnPacketSent(
QuicByteCount bytes,
HasRetransmittableData has_retransmittable_data) {
// Only pace data packets once we have an updated RTT.
- if (has_retransmittable_data == HAS_RETRANSMITTABLE_DATA && updated_rtt_) {
+ if (has_retransmittable_data == HAS_RETRANSMITTABLE_DATA && has_valid_rtt_) {
// The next packet should be sent as soon as the current packets has
// been transferred. We pace at twice the rate of the underlying
// sender's bandwidth estimate to help ensure that pacing doesn't become
@@ -63,17 +63,13 @@ void PacingSender::OnRetransmissionTimeout(bool packets_retransmitted) {
sender_->OnRetransmissionTimeout(packets_retransmitted);
}
-void PacingSender::OnPacketAbandoned(QuicPacketSequenceNumber sequence_number,
- QuicByteCount abandoned_bytes) {
- sender_->OnPacketAbandoned(sequence_number, abandoned_bytes);
-}
-
QuicTime::Delta PacingSender::TimeUntilSend(
QuicTime now,
+ QuicByteCount bytes_in_flight,
HasRetransmittableData has_retransmittable_data) {
QuicTime::Delta time_until_send =
- sender_->TimeUntilSend(now, has_retransmittable_data);
- if (!updated_rtt_) {
+ sender_->TimeUntilSend(now, bytes_in_flight, has_retransmittable_data);
+ if (!has_valid_rtt_) {
// Don't pace if we don't have an updated RTT estimate.
return time_until_send;
}
@@ -117,11 +113,6 @@ QuicBandwidth PacingSender::BandwidthEstimate() const {
return sender_->BandwidthEstimate();
}
-void PacingSender::OnRttUpdated(QuicPacketSequenceNumber largest_observed) {
- updated_rtt_= true;
- sender_->OnRttUpdated(largest_observed);
-}
-
QuicTime::Delta PacingSender::RetransmissionDelay() const {
return sender_->RetransmissionDelay();
}