diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /third_party/libwebrtc/test/network/network_emulation_manager.cc | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/test/network/network_emulation_manager.cc')
-rw-r--r-- | third_party/libwebrtc/test/network/network_emulation_manager.cc | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/third_party/libwebrtc/test/network/network_emulation_manager.cc b/third_party/libwebrtc/test/network/network_emulation_manager.cc index 97c0bc1ba8..dd0e93d8ee 100644 --- a/third_party/libwebrtc/test/network/network_emulation_manager.cc +++ b/third_party/libwebrtc/test/network/network_emulation_manager.cc @@ -13,6 +13,7 @@ #include <algorithm> #include <memory> +#include "api/field_trials_view.h" #include "api/units/time_delta.h" #include "api/units/timestamp.h" #include "call/simulated_network.h" @@ -30,10 +31,12 @@ constexpr uint32_t kMinIPv4Address = 0xC0A80000; // uint32_t representation of 192.168.255.255 address constexpr uint32_t kMaxIPv4Address = 0xC0A8FFFF; -std::unique_ptr<TimeController> CreateTimeController(TimeMode mode) { +std::unique_ptr<TimeController> CreateTimeController( + TimeMode mode, + const FieldTrialsView* field_trials) { switch (mode) { case TimeMode::kRealTime: - return std::make_unique<RealTimeController>(); + return std::make_unique<RealTimeController>(field_trials); case TimeMode::kSimulated: // Using an offset of 100000 to get nice fixed width and readable // timestamps in typical test scenarios. @@ -46,10 +49,11 @@ std::unique_ptr<TimeController> CreateTimeController(TimeMode mode) { NetworkEmulationManagerImpl::NetworkEmulationManagerImpl( TimeMode mode, - EmulatedNetworkStatsGatheringMode stats_gathering_mode) + EmulatedNetworkStatsGatheringMode stats_gathering_mode, + const FieldTrialsView* field_trials) : time_mode_(mode), stats_gathering_mode_(stats_gathering_mode), - time_controller_(CreateTimeController(mode)), + time_controller_(CreateTimeController(mode, field_trials)), clock_(time_controller_->GetClock()), next_node_id_(1), next_ip4_address_(kMinIPv4Address), @@ -75,8 +79,9 @@ EmulatedNetworkNode* NetworkEmulationManagerImpl::CreateEmulatedNode( EmulatedNetworkNode* NetworkEmulationManagerImpl::CreateEmulatedNode( std::unique_ptr<NetworkBehaviorInterface> network_behavior) { - auto node = std::make_unique<EmulatedNetworkNode>( - clock_, &task_queue_, std::move(network_behavior), stats_gathering_mode_); + auto node = std::make_unique<EmulatedNetworkNode>(clock_, task_queue_.Get(), + std::move(network_behavior), + stats_gathering_mode_); EmulatedNetworkNode* out = node.get(); task_queue_.PostTask([this, node = std::move(node)]() mutable { network_nodes_.push_back(std::move(node)); @@ -111,7 +116,7 @@ EmulatedEndpointImpl* NetworkEmulationManagerImpl::CreateEndpoint( auto node = std::make_unique<EmulatedEndpointImpl>( EmulatedEndpointImpl::Options(next_node_id_++, *ip, config, stats_gathering_mode_), - config.start_as_enabled, &task_queue_, clock_); + config.start_as_enabled, task_queue_.Get(), clock_); EmulatedEndpointImpl* out = node.get(); endpoints_.push_back(std::move(node)); return out; |