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

Unified Diff: net/quic/quic_sent_packet_manager.cc

Issue 2130103002: Landing Recent QUIC changes until 2016-07-02 02:45 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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_received_packet_manager_test.cc ('k') | net/quic/quic_sent_packet_manager_test.cc » ('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 33e79fec8772c65adcd7e6b5f814231888a06c8b..7ec63fc2fb7f235abe1fe11bd6c7b559060f64f1 100644
--- a/net/quic/quic_sent_packet_manager.cc
+++ b/net/quic/quic_sent_packet_manager.cc
@@ -163,14 +163,6 @@ void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) {
config.HasClientSentConnectionOption(kUNDO, perspective_)) {
undo_pending_retransmits_ = true;
}
- if (!FLAGS_quic_ignore_srbf && config.HasReceivedSocketReceiveBuffer()) {
- receive_buffer_bytes_ =
- max(kMinSocketReceiveBuffer,
- static_cast<QuicByteCount>(config.ReceivedSocketReceiveBuffer()));
- QuicByteCount max_cwnd_bytes = static_cast<QuicByteCount>(
- receive_buffer_bytes_ * kConservativeReceiveBufferFraction);
- send_algorithm_->SetMaxCongestionWindow(max_cwnd_bytes);
- }
send_algorithm_->SetFromConfig(config, perspective_);
if (network_change_visitor_ != nullptr) {
@@ -772,8 +764,7 @@ bool QuicSentPacketManager::MaybeUpdateRTT(const QuicAckFrame& ack_frame,
return false;
}
- QuicTime::Delta send_delta =
- ack_receive_time.Subtract(transmission_info.sent_time);
+ QuicTime::Delta send_delta = ack_receive_time - transmission_info.sent_time;
const int kMaxSendDeltaSeconds = 30;
if (FLAGS_quic_socket_walltimestamps &&
send_delta.ToSeconds() > kMaxSendDeltaSeconds) {
@@ -815,7 +806,7 @@ const QuicTime QuicSentPacketManager::GetRetransmissionTime() const {
}
switch (GetRetransmissionMode()) {
case HANDSHAKE_MODE:
- return clock_->ApproximateNow().Add(GetCryptoRetransmissionDelay());
+ return clock_->ApproximateNow() + GetCryptoRetransmissionDelay();
case LOSS_MODE:
return loss_algorithm_->GetLossTimeout();
case TLP_MODE: {
@@ -823,17 +814,17 @@ const QuicTime QuicSentPacketManager::GetRetransmissionTime() const {
// set the timer based on the earliest retransmittable packet.
// Base the updated timer on the send time of the last packet.
const QuicTime sent_time = unacked_packets_.GetLastPacketSentTime();
- const QuicTime tlp_time = sent_time.Add(GetTailLossProbeDelay());
+ const QuicTime tlp_time = sent_time + GetTailLossProbeDelay();
// Ensure the TLP timer never gets set to a time in the past.
return QuicTime::Max(clock_->ApproximateNow(), tlp_time);
}
case RTO_MODE: {
// The RTO is based on the first outstanding packet.
const QuicTime sent_time = unacked_packets_.GetLastPacketSentTime();
- QuicTime rto_time = sent_time.Add(GetRetransmissionDelay());
+ QuicTime rto_time = sent_time + GetRetransmissionDelay();
// Wait for TLP packets to be acked before an RTO fires.
QuicTime tlp_time =
- unacked_packets_.GetLastPacketSentTime().Add(GetTailLossProbeDelay());
+ unacked_packets_.GetLastPacketSentTime() + GetTailLossProbeDelay();
return QuicTime::Max(tlp_time, rto_time);
}
}
@@ -866,10 +857,9 @@ const QuicTime::Delta QuicSentPacketManager::GetTailLossProbeDelay() const {
static_cast<int64_t>(0.5 * srtt.ToMilliseconds())));
}
if (!unacked_packets_.HasMultipleInFlightPackets()) {
- return QuicTime::Delta::Max(
- srtt.Multiply(2),
- srtt.Multiply(1.5).Add(
- QuicTime::Delta::FromMilliseconds(kMinRetransmissionTimeMs / 2)));
+ return QuicTime::Delta::Max(2 * srtt,
+ 1.5 * srtt + QuicTime::Delta::FromMilliseconds(
+ kMinRetransmissionTimeMs / 2));
}
return QuicTime::Delta::FromMilliseconds(
max(kMinTailLossProbeTimeoutMs,
@@ -888,8 +878,9 @@ const QuicTime::Delta QuicSentPacketManager::GetRetransmissionDelay() const {
}
// Calculate exponential back off.
- retransmission_delay = retransmission_delay.Multiply(
- 1 << min<size_t>(consecutive_rto_count_, kMaxRetransmissions));
+ retransmission_delay =
+ retransmission_delay *
+ (1 << min<size_t>(consecutive_rto_count_, kMaxRetransmissions));
if (retransmission_delay.ToMilliseconds() > kMaxRetransmissionTimeMs) {
return QuicTime::Delta::FromMilliseconds(kMaxRetransmissionTimeMs);
« no previous file with comments | « net/quic/quic_received_packet_manager_test.cc ('k') | net/quic/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698