Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 // Delay in addition to capacity induced delay. | 73 // Delay in addition to capacity induced delay. |
| 74 int queue_delay_ms = 0; | 74 int queue_delay_ms = 0; |
| 75 // Standard deviation of the extra delay. | 75 // Standard deviation of the extra delay. |
| 76 int delay_standard_deviation_ms = 0; | 76 int delay_standard_deviation_ms = 0; |
| 77 // Link capacity in kbps. | 77 // Link capacity in kbps. |
| 78 int link_capacity_kbps = 0; | 78 int link_capacity_kbps = 0; |
| 79 // Random packet loss. | 79 // Random packet loss. |
| 80 int loss_percent = 0; | 80 int loss_percent = 0; |
| 81 // If packets are allowed to be reordered. | 81 // If packets are allowed to be reordered. |
| 82 bool allow_reordering = false; | 82 bool allow_reordering = false; |
| 83 // The average length of a burst of lost packets. | |
| 84 int avg_burst_loss_length = -1; | |
| 83 }; | 85 }; |
| 84 | 86 |
| 85 FakeNetworkPipe(Clock* clock, const FakeNetworkPipe::Config& config); | 87 FakeNetworkPipe(Clock* clock, const FakeNetworkPipe::Config& config); |
| 86 FakeNetworkPipe(Clock* clock, | 88 FakeNetworkPipe(Clock* clock, |
| 87 const FakeNetworkPipe::Config& config, | 89 const FakeNetworkPipe::Config& config, |
| 88 uint64_t seed); | 90 uint64_t seed); |
| 89 ~FakeNetworkPipe(); | 91 ~FakeNetworkPipe(); |
| 90 | 92 |
| 91 // Must not be called in parallel with SendPacket or Process. | 93 // Must not be called in parallel with SendPacket or Process. |
| 92 void SetReceiver(PacketReceiver* receiver); | 94 void SetReceiver(PacketReceiver* receiver); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 std::multiset<NetworkPacket*, PacketArrivalTimeComparator> delay_link_; | 128 std::multiset<NetworkPacket*, PacketArrivalTimeComparator> delay_link_; |
| 127 | 129 |
| 128 // Link configuration. | 130 // Link configuration. |
| 129 Config config_; | 131 Config config_; |
| 130 | 132 |
| 131 // Statistics. | 133 // Statistics. |
| 132 size_t dropped_packets_; | 134 size_t dropped_packets_; |
| 133 size_t sent_packets_; | 135 size_t sent_packets_; |
| 134 int64_t total_packet_delay_; | 136 int64_t total_packet_delay_; |
| 135 | 137 |
| 138 // Are we currently dropping a burst of packets? | |
| 139 bool bursting_; | |
| 140 | |
| 141 // The probability to drop the packet if we are currently dropping a | |
| 142 // burst of packet | |
| 143 double prob_loss_bursting_; | |
| 144 | |
| 145 // The probability to drop F%a burst of packets. | |
|
terelius
2016/05/30 15:40:23
F%a -> a
philipel
2016/05/30 16:05:39
Done.
| |
| 146 double prob_start_bursting_; | |
| 147 | |
| 136 int64_t next_process_time_; | 148 int64_t next_process_time_; |
| 137 | 149 |
| 138 RTC_DISALLOW_COPY_AND_ASSIGN(FakeNetworkPipe); | 150 RTC_DISALLOW_COPY_AND_ASSIGN(FakeNetworkPipe); |
| 139 }; | 151 }; |
| 140 | 152 |
| 141 } // namespace webrtc | 153 } // namespace webrtc |
| 142 | 154 |
| 143 #endif // WEBRTC_TEST_FAKE_NETWORK_PIPE_H_ | 155 #endif // WEBRTC_TEST_FAKE_NETWORK_PIPE_H_ |
| OLD | NEW |