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

Side by Side Diff: net/tools/quic/test_tools/packet_dropping_test_writer.h

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_ 5 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_
6 #define NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_ 6 #define NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 10
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 79
80 // The percent of time a packet is simulated as being reordered. 80 // The percent of time a packet is simulated as being reordered.
81 void set_fake_reorder_percentage(int32 fake_packet_reorder_percentage) { 81 void set_fake_reorder_percentage(int32 fake_packet_reorder_percentage) {
82 DCHECK(clock_); 82 DCHECK(clock_);
83 base::AutoLock locked(config_mutex_); 83 base::AutoLock locked(config_mutex_);
84 DCHECK(!fake_packet_delay_.IsZero()); 84 DCHECK(!fake_packet_delay_.IsZero());
85 fake_packet_reorder_percentage_ = fake_packet_reorder_percentage; 85 fake_packet_reorder_percentage_ = fake_packet_reorder_percentage;
86 } 86 }
87 87
88 // The percent of time WritePacket will block and set WriteResult's status 88 // The delay before writing this packet.
89 // to WRITE_STATUS_BLOCKED.
90 void set_fake_packet_delay(QuicTime::Delta fake_packet_delay) { 89 void set_fake_packet_delay(QuicTime::Delta fake_packet_delay) {
91 DCHECK(clock_); 90 DCHECK(clock_);
92 base::AutoLock locked(config_mutex_); 91 base::AutoLock locked(config_mutex_);
93 fake_packet_delay_ = fake_packet_delay; 92 fake_packet_delay_ = fake_packet_delay;
94 } 93 }
95 94
96 // The maximum bandwidth and buffer size of the connection. When these are 95 // The maximum bandwidth and buffer size of the connection. When these are
97 // set, packets will be delayed until a connection with that bandwidth would 96 // set, packets will be delayed until a connection with that bandwidth would
98 // transmit it. Once the |buffer_size| is reached, all new packets are 97 // transmit it. Once the |buffer_size| is reached, all new packets are
99 // dropped. 98 // dropped.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 QuicByteCount buffer_size_; 149 QuicByteCount buffer_size_;
151 150
152 DISALLOW_COPY_AND_ASSIGN(PacketDroppingTestWriter); 151 DISALLOW_COPY_AND_ASSIGN(PacketDroppingTestWriter);
153 }; 152 };
154 153
155 } // namespace test 154 } // namespace test
156 } // namespace tools 155 } // namespace tools
157 } // namespace net 156 } // namespace net
158 157
159 #endif // NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_ 158 #endif // NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_
OLDNEW
« no previous file with comments | « net/tools/quic/quic_time_wait_list_manager_test.cc ('k') | net/tools/tld_cleanup/tld_cleanup.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698