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

Unified Diff: net/tools/quic/test_tools/packet_dropping_test_writer.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 side-by-side diff with in-line comments
Download patch
Index: net/tools/quic/test_tools/packet_dropping_test_writer.cc
diff --git a/net/tools/quic/test_tools/packet_dropping_test_writer.cc b/net/tools/quic/test_tools/packet_dropping_test_writer.cc
index 59cc9f36b488f1a47f5e85d6d5cc21c8ad0ccf6c..5e1bfb8106394d073e442188ea7308240620adda 100644
--- a/net/tools/quic/test_tools/packet_dropping_test_writer.cc
+++ b/net/tools/quic/test_tools/packet_dropping_test_writer.cc
@@ -55,7 +55,7 @@ PacketDroppingTestWriter::PacketDroppingTestWriter()
fake_packet_delay_(QuicTime::Delta::Zero()),
fake_bandwidth_(QuicBandwidth::Zero()),
buffer_size_(0) {
- uint32 seed = base::RandInt(0, std::numeric_limits<int32>::max());
+ uint32_t seed = base::RandInt(0, std::numeric_limits<int32_t>::max());
VLOG(1) << "Seeding packet loss with " << seed;
simple_random_.set_seed(seed);
}
@@ -81,20 +81,21 @@ WriteResult PacketDroppingTestWriter::WritePacket(
base::AutoLock locked(config_mutex_);
if (fake_drop_first_n_packets_ > 0 &&
- num_calls_to_write_ <= static_cast<uint64>(fake_drop_first_n_packets_)) {
+ num_calls_to_write_ <=
+ static_cast<uint64_t>(fake_drop_first_n_packets_)) {
DVLOG(1) << "Dropping first " << fake_drop_first_n_packets_
<< " packets (packet number " << num_calls_to_write_ << ")";
return WriteResult(WRITE_STATUS_OK, buf_len);
}
if (fake_packet_loss_percentage_ > 0 &&
simple_random_.RandUint64() % 100 <
- static_cast<uint64>(fake_packet_loss_percentage_)) {
+ static_cast<uint64_t>(fake_packet_loss_percentage_)) {
DVLOG(1) << "Dropping packet.";
return WriteResult(WRITE_STATUS_OK, buf_len);
}
if (fake_blocked_socket_percentage_ > 0 &&
simple_random_.RandUint64() % 100 <
- static_cast<uint64>(fake_blocked_socket_percentage_)) {
+ static_cast<uint64_t>(fake_blocked_socket_percentage_)) {
CHECK(on_can_write_.get() != nullptr);
DVLOG(1) << "Blocking socket.";
if (!write_unblocked_alarm_->IsSet()) {
@@ -162,7 +163,7 @@ QuicTime PacketDroppingTestWriter::ReleaseNextPacket() {
// Determine if we should re-order.
if (delayed_packets_.size() > 1 && fake_packet_reorder_percentage_ > 0 &&
simple_random_.RandUint64() % 100 <
- static_cast<uint64>(fake_packet_reorder_percentage_)) {
+ static_cast<uint64_t>(fake_packet_reorder_percentage_)) {
DVLOG(1) << "Reordering packets.";
++iter;
// Swap the send times when re-ordering packets.
« no previous file with comments | « net/tools/quic/test_tools/packet_dropping_test_writer.h ('k') | net/tools/quic/test_tools/quic_client_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698