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/logging.h" | 10 #include "base/logging.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 namespace tools { | 22 namespace tools { |
23 namespace test { | 23 namespace test { |
24 | 24 |
25 // 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 |
26 // and has a blocked socket a configured percentage of the time. Also provides | 26 // and has a blocked socket a configured percentage of the time. Also provides |
27 // the options to delay packets and reorder packets if delay is enabled. | 27 // the options to delay packets and reorder packets if delay is enabled. |
28 class PacketDroppingTestWriter : public net::test::QuicTestWriter { | 28 class PacketDroppingTestWriter : public net::test::QuicTestWriter { |
29 public: | 29 public: |
30 PacketDroppingTestWriter(); | 30 PacketDroppingTestWriter(); |
31 | 31 |
32 virtual ~PacketDroppingTestWriter(); | 32 virtual ~PacketDroppingTestWriter() OVERRIDE; |
33 | 33 |
34 void SetConnectionHelper(QuicEpollConnectionHelper* helper); | 34 void SetConnectionHelper(QuicEpollConnectionHelper* helper); |
35 | 35 |
36 // QuicPacketWriter methods: | 36 // QuicPacketWriter methods: |
37 virtual WriteResult WritePacket( | 37 virtual WriteResult WritePacket( |
38 const char* buffer, size_t buf_len, | 38 const char* buffer, size_t buf_len, |
39 const IPAddressNumber& self_address, | 39 const IPAddressNumber& self_address, |
40 const IPEndPoint& peer_address, | 40 const IPEndPoint& peer_address, |
41 QuicBlockedWriterInterface* blocked_writer) OVERRIDE; | 41 QuicBlockedWriterInterface* blocked_writer) OVERRIDE; |
42 | 42 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 QuicByteCount buffer_size_; | 137 QuicByteCount buffer_size_; |
138 | 138 |
139 DISALLOW_COPY_AND_ASSIGN(PacketDroppingTestWriter); | 139 DISALLOW_COPY_AND_ASSIGN(PacketDroppingTestWriter); |
140 }; | 140 }; |
141 | 141 |
142 } // namespace test | 142 } // namespace test |
143 } // namespace tools | 143 } // namespace tools |
144 } // namespace net | 144 } // namespace net |
145 | 145 |
146 #endif // NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_ | 146 #endif // NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_ |
OLD | NEW |