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

Unified Diff: net/quic/congestion_control/send_algorithm_simulator.cc

Issue 1502503004: Remove kuint64max. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@kint8
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/congestion_control/send_algorithm_simulator.cc
diff --git a/net/quic/congestion_control/send_algorithm_simulator.cc b/net/quic/congestion_control/send_algorithm_simulator.cc
index a295708ab5fa476d98581cf3956e3c9e5c36da64..3078b5bc72a66c75d2e91d5955e2ea8342742a01 100644
--- a/net/quic/congestion_control/send_algorithm_simulator.cc
+++ b/net/quic/congestion_control/send_algorithm_simulator.cc
@@ -69,7 +69,7 @@ SendAlgorithmSimulator::SendAlgorithmSimulator(
rtt_(rtt),
buffer_size_(1000000),
delayed_ack_timer_(QuicTime::Delta::FromMilliseconds(100)) {
- uint32 seed = base::RandInt(0, std::numeric_limits<int32>::max());
+ uint32_t seed = base::RandInt(0, std::numeric_limits<int32_t>::max());
mmenke 2015/12/07 16:06:51 include stdint.h.
Avi (use Gerrit) 2015/12/07 16:30:06 Done.
DVLOG(1) << "Seeding SendAlgorithmSimulator with " << seed;
simple_random_.set_seed(seed);
}
@@ -89,7 +89,8 @@ void SendAlgorithmSimulator::AddTransfer(
}
void SendAlgorithmSimulator::TransferBytes() {
- TransferBytes(kuint64max, QuicTime::Delta::Infinite());
+ TransferBytes(std::numeric_limits<uint64_t>::max(),
+ QuicTime::Delta::Infinite());
}
void SendAlgorithmSimulator::TransferBytes(QuicByteCount max_bytes,
@@ -186,8 +187,8 @@ QuicTime::Delta SendAlgorithmSimulator::FindNextAcked(Transfer* transfer) {
Sender* sender = transfer->sender;
if (sender->next_acked == sender->last_acked) {
// Determine if the next ack is lost only once, to ensure determinism.
- lose_next_ack_ =
- reverse_loss_rate_ * kuint64max > simple_random_.RandUint64();
+ lose_next_ack_ = reverse_loss_rate_ * std::numeric_limits<uint64_t>::max() >
+ simple_random_.RandUint64();
}
QuicPacketNumber next_acked = sender->last_acked;
@@ -357,10 +358,12 @@ void SendAlgorithmSimulator::SendDataNow(Transfer* transfer) {
// TODO(ianswett): This buffer simulation is an approximation.
// An ack time of zero means loss.
bool packet_lost =
- forward_loss_rate_ * kuint64max > simple_random_.RandUint64();
+ forward_loss_rate_ * std::numeric_limits<uint64_t>::max() >
+ simple_random_.RandUint64();
// Handle correlated loss.
if (!sent_packets_.empty() && sent_packets_.back().lost &&
- loss_correlation_ * kuint64max > simple_random_.RandUint64()) {
+ loss_correlation_ * std::numeric_limits<uint64_t>::max() >
+ simple_random_.RandUint64()) {
packet_lost = true;
}
DVLOG(1) << "losing packet:" << sender->last_sent

Powered by Google App Engine
This is Rietveld 408576698