Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Unified Diff: webrtc/test/fake_network_pipe.h

Issue 1512853002: Nuke TickTime::UseFakeClock. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: feedback Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/test/direct_transport.cc ('k') | webrtc/test/fake_network_pipe.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..33661c759254d41a49c7996aac09e024fed83283 100644
--- a/webrtc/test/fake_network_pipe.h
+++ b/webrtc/test/fake_network_pipe.h
@@ -21,6 +21,7 @@
namespace webrtc {
+class Clock;
class CriticalSectionWrapper;
class NetworkPacket;
class PacketReceiver;
@@ -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_;
« no previous file with comments | « webrtc/test/direct_transport.cc ('k') | webrtc/test/fake_network_pipe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698