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

Side by Side Diff: net/quic/congestion_control/send_algorithm_simulator.cc

Issue 1811043002: Landing Recent QUIC changes until 2016-03-15 16:26 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add an export clause. Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/congestion_control/send_algorithm_simulator.h" 5 #include "net/quic/congestion_control/send_algorithm_simulator.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 for (vector<Transfer>::iterator it = pending_transfers_.begin(); 141 for (vector<Transfer>::iterator it = pending_transfers_.begin();
142 it != pending_transfers_.end(); ++it) { 142 it != pending_transfers_.end(); ++it) {
143 // If we've already sent enough bytes, wait for them to be acked. 143 // If we've already sent enough bytes, wait for them to be acked.
144 if (it->bytes_acked + it->bytes_in_flight >= it->num_bytes) { 144 if (it->bytes_acked + it->bytes_in_flight >= it->num_bytes) {
145 continue; 145 continue;
146 } 146 }
147 // If the flow hasn't started, use the start time. 147 // If the flow hasn't started, use the start time.
148 QuicTime::Delta transfer_send_time = it->start_time.Subtract(clock_->Now()); 148 QuicTime::Delta transfer_send_time = it->start_time.Subtract(clock_->Now());
149 if (clock_->Now() >= it->start_time) { 149 if (clock_->Now() >= it->start_time) {
150 transfer_send_time = it->sender->send_algorithm->TimeUntilSend( 150 transfer_send_time = it->sender->send_algorithm->TimeUntilSend(
151 clock_->Now(), it->bytes_in_flight, HAS_RETRANSMITTABLE_DATA); 151 clock_->Now(), it->bytes_in_flight);
152 } 152 }
153 if (transfer_send_time < next_send_time) { 153 if (transfer_send_time < next_send_time) {
154 next_send_time = transfer_send_time; 154 next_send_time = transfer_send_time;
155 transfer = &(*it); 155 transfer = &(*it);
156 } 156 }
157 } 157 }
158 DVLOG(1) << "NextSendTime returning delta(ms):" 158 DVLOG(1) << "NextSendTime returning delta(ms):"
159 << next_send_time.ToMilliseconds() << ", transfer '" 159 << next_send_time.ToMilliseconds() << ", transfer '"
160 << transfer->name; 160 << transfer->name;
161 return PacketEvent(next_send_time, transfer); 161 return PacketEvent(next_send_time, transfer);
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 sent_packets_.push_back(SentPacket(sender->last_sent, clock_->Now(), 385 sent_packets_.push_back(SentPacket(sender->last_sent, clock_->Now(),
386 ack_time, packet_lost, transfer)); 386 ack_time, packet_lost, transfer));
387 } else { 387 } else {
388 DVLOG(1) << "losing packet:" << sender->last_sent 388 DVLOG(1) << "losing packet:" << sender->last_sent
389 << " name:" << transfer->name << " because the buffer was full."; 389 << " name:" << transfer->name << " because the buffer was full.";
390 } 390 }
391 transfer->bytes_in_flight += kPacketSize; 391 transfer->bytes_in_flight += kPacketSize;
392 } 392 }
393 393
394 } // namespace net 394 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/send_algorithm_interface.h ('k') | net/quic/congestion_control/tcp_cubic_sender_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698