OLD | NEW |
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 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
14 #include "net/quic/quic_alarm.h" | 14 #include "net/quic/quic_alarm.h" |
| 15 #include "net/quic/test_tools/quic_test_utils.h" |
15 #include "net/tools/quic/quic_epoll_clock.h" | 16 #include "net/tools/quic/quic_epoll_clock.h" |
16 #include "net/tools/quic/quic_packet_writer_wrapper.h" | 17 #include "net/tools/quic/quic_packet_writer_wrapper.h" |
17 #include "net/tools/quic/test_tools/quic_test_client.h" | 18 #include "net/tools/quic/test_tools/quic_test_client.h" |
18 #include "net/tools/quic/test_tools/quic_test_utils.h" | 19 #include "net/tools/quic/test_tools/quic_test_utils.h" |
19 | 20 |
20 namespace net { | 21 namespace net { |
21 namespace tools { | 22 namespace tools { |
22 namespace test { | 23 namespace test { |
23 | 24 |
24 // Simulates a connection that drops packets a configured percentage of the time | 25 // Simulates a connection that drops packets a configured percentage of the time |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 const IPEndPoint peer_address; | 128 const IPEndPoint peer_address; |
128 QuicTime send_time; | 129 QuicTime send_time; |
129 }; | 130 }; |
130 | 131 |
131 typedef std::list<DelayedWrite> DelayedPacketList; | 132 typedef std::list<DelayedWrite> DelayedPacketList; |
132 | 133 |
133 const QuicClock* clock_; | 134 const QuicClock* clock_; |
134 scoped_ptr<QuicAlarm> write_unblocked_alarm_; | 135 scoped_ptr<QuicAlarm> write_unblocked_alarm_; |
135 scoped_ptr<QuicAlarm> delay_alarm_; | 136 scoped_ptr<QuicAlarm> delay_alarm_; |
136 scoped_ptr<Delegate> on_can_write_; | 137 scoped_ptr<Delegate> on_can_write_; |
137 SimpleRandom simple_random_; | 138 net::test::SimpleRandom simple_random_; |
138 // Stored packets delayed by fake packet delay or bandwidth restrictions. | 139 // Stored packets delayed by fake packet delay or bandwidth restrictions. |
139 DelayedPacketList delayed_packets_; | 140 DelayedPacketList delayed_packets_; |
140 QuicByteCount cur_buffer_size_; | 141 QuicByteCount cur_buffer_size_; |
141 | 142 |
142 base::Lock config_mutex_; | 143 base::Lock config_mutex_; |
143 int32 fake_packet_loss_percentage_; | 144 int32 fake_packet_loss_percentage_; |
144 int32 fake_blocked_socket_percentage_; | 145 int32 fake_blocked_socket_percentage_; |
145 int32 fake_packet_reorder_percentage_; | 146 int32 fake_packet_reorder_percentage_; |
146 QuicTime::Delta fake_packet_delay_; | 147 QuicTime::Delta fake_packet_delay_; |
147 QuicBandwidth fake_bandwidth_; | 148 QuicBandwidth fake_bandwidth_; |
148 QuicByteCount buffer_size_; | 149 QuicByteCount buffer_size_; |
149 | 150 |
150 DISALLOW_COPY_AND_ASSIGN(PacketDroppingTestWriter); | 151 DISALLOW_COPY_AND_ASSIGN(PacketDroppingTestWriter); |
151 }; | 152 }; |
152 | 153 |
153 } // namespace test | 154 } // namespace test |
154 } // namespace tools | 155 } // namespace tools |
155 } // namespace net | 156 } // namespace net |
156 | 157 |
157 #endif // NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_ | 158 #endif // NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_ |
OLD | NEW |