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

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

Issue 1535363003: Switch to standard integer types in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stddef Created 5 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 unified diff | Download patch
« no previous file with comments | « net/quic/congestion_control/pacing_sender.h ('k') | net/quic/congestion_control/prr_sender.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/pacing_sender.h" 5 #include "net/quic/congestion_control/pacing_sender.h"
6 6
7 using std::min; 7 using std::min;
8 8
9 namespace net { 9 namespace net {
10 10
11 PacingSender::PacingSender(SendAlgorithmInterface* sender, 11 PacingSender::PacingSender(SendAlgorithmInterface* sender,
12 QuicTime::Delta alarm_granularity, 12 QuicTime::Delta alarm_granularity,
13 uint32 initial_packet_burst) 13 uint32_t initial_packet_burst)
14 : sender_(sender), 14 : sender_(sender),
15 alarm_granularity_(alarm_granularity), 15 alarm_granularity_(alarm_granularity),
16 initial_packet_burst_(initial_packet_burst), 16 initial_packet_burst_(initial_packet_burst),
17 burst_tokens_(initial_packet_burst), 17 burst_tokens_(initial_packet_burst),
18 last_delayed_packet_sent_time_(QuicTime::Zero()), 18 last_delayed_packet_sent_time_(QuicTime::Zero()),
19 ideal_next_packet_send_time_(QuicTime::Zero()), 19 ideal_next_packet_send_time_(QuicTime::Zero()),
20 was_last_send_delayed_(false) {} 20 was_last_send_delayed_(false) {}
21 21
22 PacingSender::~PacingSender() {} 22 PacingSender::~PacingSender() {}
23 23
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 if (has_retransmittable_data != HAS_RETRANSMITTABLE_DATA) { 61 if (has_retransmittable_data != HAS_RETRANSMITTABLE_DATA) {
62 return in_flight; 62 return in_flight;
63 } 63 }
64 // If in recovery, the connection is not coming out of quiescence. 64 // If in recovery, the connection is not coming out of quiescence.
65 if (bytes_in_flight == 0 && !sender_->InRecovery()) { 65 if (bytes_in_flight == 0 && !sender_->InRecovery()) {
66 // Add more burst tokens anytime the connection is leaving quiescence, but 66 // Add more burst tokens anytime the connection is leaving quiescence, but
67 // limit it to the equivalent of a single bulk write, not exceeding the 67 // limit it to the equivalent of a single bulk write, not exceeding the
68 // current CWND in packets. 68 // current CWND in packets.
69 burst_tokens_ = min( 69 burst_tokens_ = min(
70 initial_packet_burst_, 70 initial_packet_burst_,
71 static_cast<uint32>(sender_->GetCongestionWindow() / kDefaultTCPMSS)); 71 static_cast<uint32_t>(sender_->GetCongestionWindow() / kDefaultTCPMSS));
72 } 72 }
73 if (burst_tokens_ > 0) { 73 if (burst_tokens_ > 0) {
74 --burst_tokens_; 74 --burst_tokens_;
75 was_last_send_delayed_ = false; 75 was_last_send_delayed_ = false;
76 last_delayed_packet_sent_time_ = QuicTime::Zero(); 76 last_delayed_packet_sent_time_ = QuicTime::Zero();
77 ideal_next_packet_send_time_ = QuicTime::Zero(); 77 ideal_next_packet_send_time_ = QuicTime::Zero();
78 return in_flight; 78 return in_flight;
79 } 79 }
80 // The next packet should be sent as soon as the current packets has been 80 // The next packet should be sent as soon as the current packets has been
81 // transferred. 81 // transferred.
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 QuicByteCount PacingSender::GetSlowStartThreshold() const { 173 QuicByteCount PacingSender::GetSlowStartThreshold() const {
174 return sender_->GetSlowStartThreshold(); 174 return sender_->GetSlowStartThreshold();
175 } 175 }
176 176
177 CongestionControlType PacingSender::GetCongestionControlType() const { 177 CongestionControlType PacingSender::GetCongestionControlType() const {
178 return sender_->GetCongestionControlType(); 178 return sender_->GetCongestionControlType();
179 } 179 }
180 180
181 } // namespace net 181 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/pacing_sender.h ('k') | net/quic/congestion_control/prr_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698