| 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" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // called after connecting if the helper is not available before. | 42 // called after connecting if the helper is not available before. |
| 43 // |on_can_write| will be triggered when fake-unblocking; ownership will be | 43 // |on_can_write| will be triggered when fake-unblocking; ownership will be |
| 44 // assumed. | 44 // assumed. |
| 45 void Initialize(QuicEpollConnectionHelper* helper, Delegate* on_can_write); | 45 void Initialize(QuicEpollConnectionHelper* helper, Delegate* on_can_write); |
| 46 | 46 |
| 47 // QuicPacketWriter methods: | 47 // QuicPacketWriter methods: |
| 48 virtual WriteResult WritePacket( | 48 virtual WriteResult WritePacket( |
| 49 const char* buffer, | 49 const char* buffer, |
| 50 size_t buf_len, | 50 size_t buf_len, |
| 51 const IPAddressNumber& self_address, | 51 const IPAddressNumber& self_address, |
| 52 const IPEndPoint& peer_address) OVERRIDE; | 52 const IPEndPoint& peer_address) override; |
| 53 | 53 |
| 54 virtual bool IsWriteBlocked() const OVERRIDE; | 54 virtual bool IsWriteBlocked() const override; |
| 55 | 55 |
| 56 virtual void SetWritable() OVERRIDE; | 56 virtual void SetWritable() override; |
| 57 | 57 |
| 58 // Writes out any packet which should have been sent by now | 58 // Writes out any packet which should have been sent by now |
| 59 // to the contained writer and returns the time | 59 // to the contained writer and returns the time |
| 60 // for the next delayed packet to be written. | 60 // for the next delayed packet to be written. |
| 61 QuicTime ReleaseOldPackets(); | 61 QuicTime ReleaseOldPackets(); |
| 62 | 62 |
| 63 void OnCanWrite(); | 63 void OnCanWrite(); |
| 64 | 64 |
| 65 // The percent of time a packet is simulated as being lost. | 65 // The percent of time a packet is simulated as being lost. |
| 66 void set_fake_packet_loss_percentage(int32 fake_packet_loss_percentage) { | 66 void set_fake_packet_loss_percentage(int32 fake_packet_loss_percentage) { |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 QuicByteCount buffer_size_; | 150 QuicByteCount buffer_size_; |
| 151 | 151 |
| 152 DISALLOW_COPY_AND_ASSIGN(PacketDroppingTestWriter); | 152 DISALLOW_COPY_AND_ASSIGN(PacketDroppingTestWriter); |
| 153 }; | 153 }; |
| 154 | 154 |
| 155 } // namespace test | 155 } // namespace test |
| 156 } // namespace tools | 156 } // namespace tools |
| 157 } // namespace net | 157 } // namespace net |
| 158 | 158 |
| 159 #endif // NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_ | 159 #endif // NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_ |
| OLD | NEW |