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

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

Issue 1138443003: Land Recent QUIC Changes until 05/13/2015 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compile error fixes Created 5 years, 7 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 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 e181fdbfcd8001598af7c8cff5f680c6f4249b93..ae1aac009cd36c378241c74e5715e4efd1b57a87 100644
--- a/net/tools/quic/test_tools/packet_dropping_test_writer.h
+++ b/net/tools/quic/test_tools/packet_dropping_test_writer.h
@@ -69,6 +69,13 @@ class PacketDroppingTestWriter : public QuicPacketWriterWrapper {
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) {
+ base::AutoLock locked(config_mutex_);
+ fake_drop_first_n_packets_ = fake_drop_first_n_packets;
+ }
+
// The percent of time WritePacket will block and set WriteResult's status
// to WRITE_STATUS_BLOCKED.
void set_fake_blocked_socket_percentage(
@@ -141,9 +148,11 @@ 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_;
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_;
QuicTime::Delta fake_packet_delay_;
« no previous file with comments | « net/tools/quic/quic_time_wait_list_manager_test.cc ('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