Chromium Code Reviews| Index: webrtc/test/fake_network_pipe.h |
| diff --git a/webrtc/test/fake_network_pipe.h b/webrtc/test/fake_network_pipe.h |
| index 74189a594c5758e6958a9e9dc38bcc8faa44907f..08d42c42e5f66b7ac394543bf9d7ff7b91b19353 100644 |
| --- a/webrtc/test/fake_network_pipe.h |
| +++ b/webrtc/test/fake_network_pipe.h |
| @@ -16,6 +16,7 @@ |
| #include "webrtc/base/constructormagic.h" |
| #include "webrtc/base/criticalsection.h" |
| #include "webrtc/base/scoped_ptr.h" |
| +#include "webrtc/system_wrappers/include/clock.h" |
|
mflodman
2015/12/09 10:11:25
Forward declare and move to cc-file.
pbos-webrtc
2015/12/09 10:19:04
Done.
|
| #include "webrtc/system_wrappers/include/event_wrapper.h" |
| #include "webrtc/typedefs.h" |
| @@ -33,26 +34,20 @@ class PacketReceiver; |
| class FakeNetworkPipe { |
| public: |
| struct Config { |
| - Config() |
| - : queue_length_packets(0), |
| - queue_delay_ms(0), |
| - delay_standard_deviation_ms(0), |
| - link_capacity_kbps(0), |
| - loss_percent(0) { |
| - } |
| + Config() {} |
| // Queue length in number of packets. |
| - size_t queue_length_packets; |
| + size_t queue_length_packets = 0; |
| // Delay in addition to capacity induced delay. |
| - int queue_delay_ms; |
| + int queue_delay_ms = 0; |
| // Standard deviation of the extra delay. |
| - int delay_standard_deviation_ms; |
| + int delay_standard_deviation_ms = 0; |
| // Link capacity in kbps. |
| - int link_capacity_kbps; |
| + int link_capacity_kbps = 0; |
| // Random packet loss. |
| - int loss_percent; |
| + int loss_percent = 0; |
| }; |
| - explicit FakeNetworkPipe(const FakeNetworkPipe::Config& config); |
| + FakeNetworkPipe(Clock* clock, const FakeNetworkPipe::Config& config); |
| ~FakeNetworkPipe(); |
| // Must not be called in parallel with SendPacket or Process. |
| @@ -76,6 +71,7 @@ class FakeNetworkPipe { |
| size_t sent_packets() { return sent_packets_; } |
| private: |
| + Clock* const clock_; |
| mutable rtc::CriticalSection lock_; |
| PacketReceiver* packet_receiver_; |
| std::queue<NetworkPacket*> capacity_link_; |