From f7f7cc93aa44a5a514e6a79771eabbc390103584 Mon Sep 17 00:00:00 2001 From: Jonas Oreland Date: Fri, 24 Apr 2020 15:37:32 +0200 Subject: [PATCH] Extend IceControllerFactoryArgs with field trial string This patch adds a field trial string for the IceController to the factory interface, the string is from the "WebRTC-IceControllerFieldTrials" key. This makes it possible to add new field trials using that key as needed. Bug: chromium:1024965 Change-Id: I50498e45da3c49b8e1d620c90c674eedc15dc16e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173900 Reviewed-by: Harald Alvestrand Commit-Queue: Jonas Oreland Cr-Commit-Position: refs/heads/master@{#31134} --- p2p/base/ice_controller_factory_interface.h | 2 ++ p2p/base/p2p_transport_channel.cc | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/p2p/base/ice_controller_factory_interface.h b/p2p/base/ice_controller_factory_interface.h index a859c07be9..bae8b8f19d 100644 --- a/p2p/base/ice_controller_factory_interface.h +++ b/p2p/base/ice_controller_factory_interface.h @@ -12,6 +12,7 @@ #define P2P_BASE_ICE_CONTROLLER_FACTORY_INTERFACE_H_ #include +#include #include "p2p/base/ice_controller_interface.h" #include "p2p/base/ice_transport_internal.h" @@ -24,6 +25,7 @@ struct IceControllerFactoryArgs { std::function ice_role_func; std::function is_connection_pruned_func; const IceFieldTrials* ice_field_trials; + std::string ice_controller_field_trials; }; class IceControllerFactoryInterface { diff --git a/p2p/base/p2p_transport_channel.cc b/p2p/base/p2p_transport_channel.cc index e3e61945cb..33325693b9 100644 --- a/p2p/base/p2p_transport_channel.cc +++ b/p2p/base/p2p_transport_channel.cc @@ -174,8 +174,7 @@ P2PTransportChannel::P2PTransportChannel( ice_event_log_.set_event_log(event_log); IceControllerFactoryArgs args{ - [this] { return GetState(); }, - [this] { return GetIceRole(); }, + [this] { return GetState(); }, [this] { return GetIceRole(); }, [this](const Connection* connection) { // TODO(webrtc:10647/jonaso): Figure out a way to remove friendship // between P2PTransportChannel and Connection. @@ -183,7 +182,7 @@ P2PTransportChannel::P2PTransportChannel( IsRemoteCandidatePruned(connection->remote_candidate()); }, &field_trials_, - }; + webrtc::field_trial::FindFullName("WebRTC-IceControllerFieldTrials")}; if (ice_controller_factory != nullptr) { ice_controller_ = ice_controller_factory->Create(args); } else {