diff --git a/api/test/simulated_network.h b/api/test/simulated_network.h index 4ddc4377d1..89345f539a 100644 --- a/api/test/simulated_network.h +++ b/api/test/simulated_network.h @@ -64,6 +64,11 @@ class NetworkSimulationInterface { int avg_burst_loss_length = -1; }; + // DO NOT USE. Method added temporary for further refactoring and will be + // removed soon. + // Sets a new configuration. This won't affect packets already in the pipe. + virtual void SetConfig(const SimulatedNetworkConfig& config) = 0; + virtual bool EnqueuePacket(PacketInFlightInfo packet_info) = 0; // Retrieves all packets that should be delivered by the given receive time. virtual std::vector DequeueDeliverablePackets( diff --git a/call/fake_network_pipe.cc b/call/fake_network_pipe.cc index 21ee652b09..e2fa2f4e99 100644 --- a/call/fake_network_pipe.cc +++ b/call/fake_network_pipe.cc @@ -18,6 +18,7 @@ #include "absl/memory/memory.h" #include "call/call.h" #include "call/fake_network_pipe.h" +#include "call/simulated_network.h" #include "rtc_base/logging.h" #include "system_wrappers/include/clock.h" diff --git a/call/fake_network_pipe.h b/call/fake_network_pipe.h index 6e2bc11c6e..531329ee72 100644 --- a/call/fake_network_pipe.h +++ b/call/fake_network_pipe.h @@ -22,7 +22,6 @@ #include "api/call/transport.h" #include "api/test/simulated_network.h" #include "call/call.h" -#include "call/simulated_network.h" #include "common_types.h" // NOLINT(build/include) #include "modules/include/module.h" #include "rtc_base/constructormagic.h" @@ -102,7 +101,7 @@ class NetworkPacket { // SimulatedNetworkInterface to simulate network behavior. class FakeNetworkPipe : public Transport, public PacketReceiver, public Module { public: - using Config = SimulatedNetwork::Config; + using Config = NetworkSimulationInterface::SimulatedNetworkConfig; // Use these constructors if you plan to insert packets using DeliverPacket(). FakeNetworkPipe(Clock* clock, const FakeNetworkPipe::Config& config); @@ -212,7 +211,7 @@ class FakeNetworkPipe : public Transport, public PacketReceiver, public Module { Clock* const clock_; // |config_lock| guards the mostly constant things like the callbacks. rtc::CriticalSection config_lock_; - const std::unique_ptr network_simulation_; + const std::unique_ptr network_simulation_; PacketReceiver* receiver_ RTC_GUARDED_BY(config_lock_); Transport* const transport_ RTC_GUARDED_BY(config_lock_); diff --git a/call/simulated_network.h b/call/simulated_network.h index 53283bfb16..0ddd1f85fc 100644 --- a/call/simulated_network.h +++ b/call/simulated_network.h @@ -33,7 +33,7 @@ class SimulatedNetwork : public NetworkSimulationInterface { ~SimulatedNetwork() override; // Sets a new configuration. This won't affect packets already in the pipe. - void SetConfig(const Config& config); + void SetConfig(const Config& config) override; void PauseTransmissionUntil(int64_t until_us); // NetworkSimulationInterface