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

Unified Diff: net/quic/quic_received_packet_manager.cc

Issue 115463002: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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_received_packet_manager.h ('k') | net/quic/quic_reliable_client_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_received_packet_manager.cc
diff --git a/net/quic/quic_received_packet_manager.cc b/net/quic/quic_received_packet_manager.cc
index 844ad43e37b14d3e746f957ec2b1d77c9d100998..b24ac7c671eaee7a728a3d46124bd84d9246ba9c 100644
--- a/net/quic/quic_received_packet_manager.cc
+++ b/net/quic/quic_received_packet_manager.cc
@@ -5,6 +5,7 @@
#include "net/quic/quic_received_packet_manager.h"
#include "base/logging.h"
+#include "base/stl_util.h"
#include "net/base/linked_hash_map.h"
using std::make_pair;
@@ -13,6 +14,17 @@ using std::min;
namespace net {
+namespace {
+
+// The maximum number of packets to ack immediately after a missing packet for
+// fast retransmission to kick in at the sender. This limit is created to
+// reduce the number of acks sent that have no benefit for fast retransmission.
+// Set to the number of nacks needed for fast retransmit plus one for protection
+// against an ack loss
+const size_t kMaxPacketsAfterNewMissing = 4;
+
+}
+
QuicReceivedPacketManager::QuicReceivedPacketManager(
CongestionFeedbackType congestion_type)
: packets_entropy_hash_(0),
@@ -60,6 +72,11 @@ void QuicReceivedPacketManager::RecordPacketReceived(
}
}
+bool QuicReceivedPacketManager::IsMissing(
+ QuicPacketSequenceNumber sequence_number) {
+ return ContainsKey(received_info_.missing_packets, sequence_number);
+}
+
bool QuicReceivedPacketManager::IsAwaitingPacket(
QuicPacketSequenceNumber sequence_number) {
return ::net::IsAwaitingPacket(received_info_, sequence_number);
@@ -213,4 +230,10 @@ bool QuicReceivedPacketManager::HasMissingPackets() {
return !received_info_.missing_packets.empty();
}
+bool QuicReceivedPacketManager::HasNewMissingPackets() {
+ return HasMissingPackets() &&
+ (received_info_.largest_observed -
+ *received_info_.missing_packets.rbegin()) <= kMaxPacketsAfterNewMissing;
+}
+
} // namespace net
« no previous file with comments | « net/quic/quic_received_packet_manager.h ('k') | net/quic/quic_reliable_client_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698