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

Unified Diff: net/quic/quic_sent_packet_manager.cc

Issue 2002083002: Add QuicSentPacketManagerInterface, and QuicSentPacketManager implements it. No functional change e… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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_sent_packet_manager.h ('k') | net/quic/quic_sent_packet_manager_interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_sent_packet_manager.cc
diff --git a/net/quic/quic_sent_packet_manager.cc b/net/quic/quic_sent_packet_manager.cc
index 756768257372694df9fe59342ccf60a0ba2bce96..f995a9129bef30f012e63c79ebf4084515c0cf81 100644
--- a/net/quic/quic_sent_packet_manager.cc
+++ b/net/quic/quic_sent_packet_manager.cc
@@ -11,7 +11,6 @@
#include "net/quic/congestion_control/general_loss_algorithm.h"
#include "net/quic/congestion_control/pacing_sender.h"
#include "net/quic/crypto/crypto_protocol.h"
-#include "net/quic/proto/cached_network_parameters.pb.h"
#include "net/quic/quic_bug_tracker.h"
#include "net/quic/quic_connection_stats.h"
#include "net/quic/quic_flags.h"
@@ -29,10 +28,6 @@ int32_t FLAGS_quic_recent_min_rtt_window_s = 60;
namespace {
static const int64_t kDefaultRetransmissionTimeMs = 500;
-// TCP RFC calls for 1 second RTO however Linux differs from this default and
-// define the minimum RTO to 200ms, we will use the same until we have data to
-// support a higher or lower value.
-static const int64_t kMinRetransmissionTimeMs = 200;
static const int64_t kMaxRetransmissionTimeMs = 60000;
// Maximum number of exponential backoffs used for RTO timeouts.
static const size_t kMaxRetransmissions = 10;
@@ -219,6 +214,10 @@ void QuicSentPacketManager::SetMaxPacingRate(QuicBandwidth max_pacing_rate) {
}
}
+void QuicSentPacketManager::SetHandshakeConfirmed() {
+ handshake_confirmed_ = true;
+}
+
void QuicSentPacketManager::OnIncomingAck(const QuicAckFrame& ack_frame,
QuicTime ack_receive_time) {
DCHECK_LE(ack_frame.largest_observed, unacked_packets_.largest_sent_packet());
@@ -278,7 +277,7 @@ void QuicSentPacketManager::OnIncomingAck(const QuicAckFrame& ack_frame,
if (debug_delegate_ != nullptr) {
debug_delegate_->OnIncomingAck(ack_frame, ack_receive_time,
unacked_packets_.largest_observed(),
- rtt_updated, GetLeastUnacked());
+ rtt_updated, GetLeastUnacked(path_id_));
}
}
@@ -353,6 +352,7 @@ void QuicSentPacketManager::HandleAckForSentPackets(
}
bool QuicSentPacketManager::HasRetransmittableFrames(
+ QuicPathId,
QuicPacketNumber packet_number) const {
return unacked_packets_.HasRetransmittableFrames(packet_number);
}
@@ -559,7 +559,8 @@ void QuicSentPacketManager::MarkPacketHandled(QuicPacketNumber packet_number,
}
}
-bool QuicSentPacketManager::IsUnacked(QuicPacketNumber packet_number) const {
+bool QuicSentPacketManager::IsUnacked(QuicPathId,
+ QuicPacketNumber packet_number) const {
return unacked_packets_.IsUnacked(packet_number);
}
@@ -567,7 +568,7 @@ bool QuicSentPacketManager::HasUnackedPackets() const {
return unacked_packets_.HasUnackedPackets();
}
-QuicPacketNumber QuicSentPacketManager::GetLeastUnacked() const {
+QuicPacketNumber QuicSentPacketManager::GetLeastUnacked(QuicPathId) const {
return unacked_packets_.GetLeastUnacked();
}
@@ -795,33 +796,21 @@ bool QuicSentPacketManager::MaybeUpdateRTT(const QuicAckFrame& ack_frame,
QuicTime::Delta QuicSentPacketManager::TimeUntilSend(
QuicTime now,
- HasRetransmittableData retransmittable) {
+ HasRetransmittableData retransmittable,
+ QuicPathId* path_id) {
+ QuicTime::Delta delay = QuicTime::Delta::Infinite();
// The TLP logic is entirely contained within QuicSentPacketManager, so the
// send algorithm does not need to be consulted.
if (pending_timer_transmission_count_ > 0) {
- return QuicTime::Delta::Zero();
- }
- return send_algorithm_->TimeUntilSend(now,
- unacked_packets_.bytes_in_flight());
-}
-
-// Uses a 25ms delayed ack timer. Also helps with better signaling
-// in low-bandwidth (< ~384 kbps), where an ack is sent per packet.
-// Ensures that the Delayed Ack timer is always set to a value lesser
-// than the retransmission timer's minimum value (MinRTO). We want the
-// delayed ack to get back to the QUIC peer before the sender's
-// retransmission timer triggers. Since we do not know the
-// reverse-path one-way delay, we assume equal delays for forward and
-// reverse paths, and ensure that the timer is set to less than half
-// of the MinRTO.
-// There may be a value in making this delay adaptive with the help of
-// the sender and a signaling mechanism -- if the sender uses a
-// different MinRTO, we may get spurious retransmissions. May not have
-// any benefits, but if the delayed ack becomes a significant source
-// of (likely, tail) latency, then consider such a mechanism.
-const QuicTime::Delta QuicSentPacketManager::DelayedAckTime() const {
- return QuicTime::Delta::FromMilliseconds(
- min(kMaxDelayedAckTimeMs, kMinRetransmissionTimeMs / 2));
+ delay = QuicTime::Delta::Zero();
+ } else {
+ delay =
+ send_algorithm_->TimeUntilSend(now, unacked_packets_.bytes_in_flight());
+ }
+ if (!delay.IsInfinite()) {
+ *path_id = path_id_;
+ }
+ return delay;
}
const QuicTime QuicSentPacketManager::GetRetransmissionTime() const {
@@ -955,7 +944,7 @@ void QuicSentPacketManager::CancelRetransmissionsForStream(
}
PendingRetransmissionMap::iterator it = pending_retransmissions_.begin();
while (it != pending_retransmissions_.end()) {
- if (HasRetransmittableFrames(it->first)) {
+ if (HasRetransmittableFrames(path_id_, it->first)) {
++it;
continue;
}
@@ -978,7 +967,8 @@ void QuicSentPacketManager::EnablePacing() {
kInitialUnpacedBurst));
}
-void QuicSentPacketManager::OnConnectionMigration(PeerAddressChangeType type) {
+void QuicSentPacketManager::OnConnectionMigration(QuicPathId,
+ PeerAddressChangeType type) {
if (type == PORT_CHANGE || type == IPV4_SUBNET_CHANGE) {
// Rtt and cwnd do not need to be reset when the peer address change is
// considered to be caused by NATs.
@@ -990,10 +980,46 @@ void QuicSentPacketManager::OnConnectionMigration(PeerAddressChangeType type) {
send_algorithm_->OnConnectionMigration();
}
+bool QuicSentPacketManager::IsHandshakeConfirmed() const {
+ return handshake_confirmed_;
+}
+
+void QuicSentPacketManager::SetDebugDelegate(DebugDelegate* debug_delegate) {
+ debug_delegate_ = debug_delegate;
+}
+
+QuicPacketNumber QuicSentPacketManager::GetLargestObserved(QuicPathId) const {
+ return unacked_packets_.largest_observed();
+}
+
+QuicPacketNumber QuicSentPacketManager::GetLargestSentPacket(QuicPathId) const {
+ return unacked_packets_.largest_sent_packet();
+}
+
+QuicPacketNumber QuicSentPacketManager::GetLeastPacketAwaitedByPeer(
+ QuicPathId) const {
+ return least_packet_awaited_by_peer_;
+}
+
+void QuicSentPacketManager::SetNetworkChangeVisitor(
+ NetworkChangeVisitor* visitor) {
+ DCHECK(!network_change_visitor_);
+ DCHECK(visitor);
+ network_change_visitor_ = visitor;
+}
+
bool QuicSentPacketManager::InSlowStart() const {
return send_algorithm_->InSlowStart();
}
+size_t QuicSentPacketManager::GetConsecutiveRtoCount() const {
+ return consecutive_rto_count_;
+}
+
+size_t QuicSentPacketManager::GetConsecutiveTlpCount() const {
+ return consecutive_tlp_count_;
+}
+
TransmissionInfo* QuicSentPacketManager::GetMutableTransmissionInfo(
QuicPacketNumber packet_number) {
return unacked_packets_.GetMutableTransmissionInfo(packet_number);
« no previous file with comments | « net/quic/quic_sent_packet_manager.h ('k') | net/quic/quic_sent_packet_manager_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698