Chromium Code Reviews| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <list> | 11 #include <list> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/scoped_ptr.h" | |
|
dcheng
2016/04/18 15:36:28
#include <memory>
Ryan Hamilton
2016/04/18 22:01:52
Agreed.
| |
| 17 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
| 18 #include "net/base/ip_address.h" | 17 #include "net/base/ip_address.h" |
| 19 #include "net/quic/quic_alarm.h" | 18 #include "net/quic/quic_alarm.h" |
| 20 #include "net/quic/test_tools/quic_test_utils.h" | 19 #include "net/quic/test_tools/quic_test_utils.h" |
| 21 #include "net/tools/quic/quic_epoll_clock.h" | 20 #include "net/tools/quic/quic_epoll_clock.h" |
| 22 #include "net/tools/quic/quic_packet_writer_wrapper.h" | 21 #include "net/tools/quic/quic_packet_writer_wrapper.h" |
| 23 #include "net/tools/quic/test_tools/quic_test_client.h" | 22 #include "net/tools/quic/test_tools/quic_test_client.h" |
| 24 | 23 |
| 25 namespace net { | 24 namespace net { |
| 26 namespace test { | 25 namespace test { |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 std::unique_ptr<PerPacketOptions> options; | 145 std::unique_ptr<PerPacketOptions> options; |
| 147 QuicTime send_time; | 146 QuicTime send_time; |
| 148 | 147 |
| 149 private: | 148 private: |
| 150 DISALLOW_COPY_AND_ASSIGN(DelayedWrite); | 149 DISALLOW_COPY_AND_ASSIGN(DelayedWrite); |
| 151 }; | 150 }; |
| 152 | 151 |
| 153 typedef std::list<DelayedWrite> DelayedPacketList; | 152 typedef std::list<DelayedWrite> DelayedPacketList; |
| 154 | 153 |
| 155 const QuicClock* clock_; | 154 const QuicClock* clock_; |
| 156 scoped_ptr<QuicAlarm> write_unblocked_alarm_; | 155 std::unique_ptr<QuicAlarm> write_unblocked_alarm_; |
| 157 scoped_ptr<QuicAlarm> delay_alarm_; | 156 std::unique_ptr<QuicAlarm> delay_alarm_; |
| 158 scoped_ptr<Delegate> on_can_write_; | 157 std::unique_ptr<Delegate> on_can_write_; |
| 159 net::test::SimpleRandom simple_random_; | 158 net::test::SimpleRandom simple_random_; |
| 160 // Stored packets delayed by fake packet delay or bandwidth restrictions. | 159 // Stored packets delayed by fake packet delay or bandwidth restrictions. |
| 161 DelayedPacketList delayed_packets_; | 160 DelayedPacketList delayed_packets_; |
| 162 QuicByteCount cur_buffer_size_; | 161 QuicByteCount cur_buffer_size_; |
| 163 uint64_t num_calls_to_write_; | 162 uint64_t num_calls_to_write_; |
| 164 | 163 |
| 165 base::Lock config_mutex_; | 164 base::Lock config_mutex_; |
| 166 int32_t fake_packet_loss_percentage_; | 165 int32_t fake_packet_loss_percentage_; |
| 167 int32_t fake_drop_first_n_packets_; | 166 int32_t fake_drop_first_n_packets_; |
| 168 int32_t fake_blocked_socket_percentage_; | 167 int32_t fake_blocked_socket_percentage_; |
| 169 int32_t fake_packet_reorder_percentage_; | 168 int32_t fake_packet_reorder_percentage_; |
| 170 QuicTime::Delta fake_packet_delay_; | 169 QuicTime::Delta fake_packet_delay_; |
| 171 QuicBandwidth fake_bandwidth_; | 170 QuicBandwidth fake_bandwidth_; |
| 172 QuicByteCount buffer_size_; | 171 QuicByteCount buffer_size_; |
| 173 | 172 |
| 174 DISALLOW_COPY_AND_ASSIGN(PacketDroppingTestWriter); | 173 DISALLOW_COPY_AND_ASSIGN(PacketDroppingTestWriter); |
| 175 }; | 174 }; |
| 176 | 175 |
| 177 } // namespace test | 176 } // namespace test |
| 178 } // namespace net | 177 } // namespace net |
| 179 | 178 |
| 180 #endif // NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_ | 179 #endif // NET_TOOLS_QUIC_TEST_TOOLS_PACKET_DROPPING_TEST_WRITER_H_ |
| OLD | NEW |