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 <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31134}
This commit is contained in:
Jonas Oreland 2020-04-24 15:37:32 +02:00 committed by Commit Bot
parent cc73ed3e70
commit f7f7cc93aa
2 changed files with 4 additions and 3 deletions

View File

@ -12,6 +12,7 @@
#define P2P_BASE_ICE_CONTROLLER_FACTORY_INTERFACE_H_
#include <memory>
#include <string>
#include "p2p/base/ice_controller_interface.h"
#include "p2p/base/ice_transport_internal.h"
@ -24,6 +25,7 @@ struct IceControllerFactoryArgs {
std::function<IceRole()> ice_role_func;
std::function<bool(const Connection*)> is_connection_pruned_func;
const IceFieldTrials* ice_field_trials;
std::string ice_controller_field_trials;
};
class IceControllerFactoryInterface {

View File

@ -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 {