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

Unified Diff: net/tools/quic/test_tools/packet_dropping_test_writer.h

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.h
diff --git a/net/tools/quic/test_tools/packet_dropping_test_writer.h b/net/tools/quic/test_tools/packet_dropping_test_writer.h
index 716571c3dc9e9fe172821d0e2c11e59d416870ea..ed5dc82f5f8bb190a63a5696e74358d8501f0fa7 100644
--- a/net/tools/quic/test_tools/packet_dropping_test_writer.h
+++ b/net/tools/quic/test_tools/packet_dropping_test_writer.h
@@ -5,11 +5,14 @@
#ifndef NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_
#define NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <list>
#include <string>
-#include "base/basictypes.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
#include "net/quic/quic_alarm.h"
@@ -62,14 +65,14 @@ class PacketDroppingTestWriter : public QuicPacketWriterWrapper {
void OnCanWrite();
// The percent of time a packet is simulated as being lost.
- void set_fake_packet_loss_percentage(int32 fake_packet_loss_percentage) {
+ void set_fake_packet_loss_percentage(int32_t fake_packet_loss_percentage) {
base::AutoLock locked(config_mutex_);
fake_packet_loss_percentage_ = fake_packet_loss_percentage;
}
// Simulate dropping the first n packets unconditionally.
// Subsequent packets will be lost at fake_packet_loss_percentage_ if set.
- void set_fake_drop_first_n_packets(int32 fake_drop_first_n_packets) {
+ void set_fake_drop_first_n_packets(int32_t fake_drop_first_n_packets) {
base::AutoLock locked(config_mutex_);
fake_drop_first_n_packets_ = fake_drop_first_n_packets;
}
@@ -77,14 +80,14 @@ class PacketDroppingTestWriter : public QuicPacketWriterWrapper {
// The percent of time WritePacket will block and set WriteResult's status
// to WRITE_STATUS_BLOCKED.
void set_fake_blocked_socket_percentage(
- int32 fake_blocked_socket_percentage) {
+ int32_t fake_blocked_socket_percentage) {
DCHECK(clock_);
base::AutoLock locked(config_mutex_);
fake_blocked_socket_percentage_ = fake_blocked_socket_percentage;
}
// The percent of time a packet is simulated as being reordered.
- void set_fake_reorder_percentage(int32 fake_packet_reorder_percentage) {
+ void set_fake_reorder_percentage(int32_t fake_packet_reorder_percentage) {
DCHECK(clock_);
base::AutoLock locked(config_mutex_);
DCHECK(!fake_packet_delay_.IsZero());
@@ -111,7 +114,7 @@ class PacketDroppingTestWriter : public QuicPacketWriterWrapper {
}
// Useful for reproducing very flaky issues.
- void set_seed(uint64 seed) { simple_random_.set_seed(seed); }
+ void set_seed(uint64_t seed) { simple_random_.set_seed(seed); }
private:
// Writes out the next packet to the contained writer and returns the time
@@ -144,13 +147,13 @@ class PacketDroppingTestWriter : public QuicPacketWriterWrapper {
// Stored packets delayed by fake packet delay or bandwidth restrictions.
DelayedPacketList delayed_packets_;
QuicByteCount cur_buffer_size_;
- uint64 num_calls_to_write_;
+ uint64_t num_calls_to_write_;
base::Lock config_mutex_;
- int32 fake_packet_loss_percentage_;
- int32 fake_drop_first_n_packets_;
- int32 fake_blocked_socket_percentage_;
- int32 fake_packet_reorder_percentage_;
+ int32_t fake_packet_loss_percentage_;
+ int32_t fake_drop_first_n_packets_;
+ int32_t fake_blocked_socket_percentage_;
+ int32_t fake_packet_reorder_percentage_;
QuicTime::Delta fake_packet_delay_;
QuicBandwidth fake_bandwidth_;
QuicByteCount buffer_size_;
« no previous file with comments | « net/tools/quic/test_tools/mock_quic_server_session_visitor.h ('k') | net/tools/quic/test_tools/packet_dropping_test_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698