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

Unified Diff: net/quic/quic_packet_generator.cc

Issue 706203003: Update from https://crrev.com/303153 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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_packet_generator.h ('k') | net/quic/quic_packet_generator_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_packet_generator.cc
diff --git a/net/quic/quic_packet_generator.cc b/net/quic/quic_packet_generator.cc
index deb6a9e90e2e4600e1b648b94400aa3e367db87d..2481ddc166263dbfcbc7f9c58716420f34684b35 100644
--- a/net/quic/quic_packet_generator.cc
+++ b/net/quic/quic_packet_generator.cc
@@ -19,10 +19,10 @@ namespace {
// avoid losing them both within the same loss episode. On the other hand,
// we expect to be able to recover from any loss in about an RTT.
// We resolve this tradeoff by sending an FEC packet atmost half an RTT,
-// or equivalently, half a cwnd, after the first protected packet. Since we
-// don't want to delay an FEC packet past half an RTT, we set the max FEC
-// group size to be half the current congestion window.
-const float kCongestionWindowMultiplierForFecGroupSize = 0.5;
+// or equivalently, half the max number of in-flight packets, the first
+// protected packet. Since we don't want to delay an FEC packet past half an
+// RTT, we set the max FEC group size to be half the current congestion window.
+const float kMaxPacketsInFlightMultiplierForFecGroupSize = 0.5;
} // namespace
@@ -85,10 +85,10 @@ QuicPacketGenerator::~QuicPacketGenerator() {
}
void QuicPacketGenerator::OnCongestionWindowChange(
- QuicByteCount congestion_window) {
+ QuicPacketCount max_packets_in_flight) {
packet_creator_.set_max_packets_per_fec_group(
- static_cast<size_t>(kCongestionWindowMultiplierForFecGroupSize *
- congestion_window / kDefaultTCPMSS));
+ static_cast<size_t>(kMaxPacketsInFlightMultiplierForFecGroupSize *
+ max_packets_in_flight));
}
void QuicPacketGenerator::SetShouldSendAck(bool also_send_feedback,
@@ -378,9 +378,9 @@ SerializedPacket QuicPacketGenerator::ReserializeAllFrames(
void QuicPacketGenerator::UpdateSequenceNumberLength(
QuicPacketSequenceNumber least_packet_awaited_by_peer,
- QuicByteCount congestion_window) {
+ QuicPacketCount max_packets_in_flight) {
return packet_creator_.UpdateSequenceNumberLength(
- least_packet_awaited_by_peer, congestion_window);
+ least_packet_awaited_by_peer, max_packets_in_flight);
}
void QuicPacketGenerator::SetConnectionIdLength(uint32 length) {
« no previous file with comments | « net/quic/quic_packet_generator.h ('k') | net/quic/quic_packet_generator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698