diff options
author | Jonas Oreland <jonaso@webrtc.org> | 2022-03-29 11:04:48 +0200 |
---|---|---|
committer | WebRTC LUCI CQ <webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-03-29 10:14:00 +0000 |
commit | e62c2f2c77bca9af93b1f8cc5a37bb9978a18844 (patch) | |
tree | 594b37ebfdc04a6eab66ab03bb6f63c5fc80fa2a /p2p | |
parent | bddfa1d9de370cb98cf023965c060d37110a6413 (diff) | |
download | webrtc-e62c2f2c77bca9af93b1f8cc5a37bb9978a18844.tar.gz |
WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 12/inf
rename WebRtcKeyValueConfig to FieldTrialsView
Bug: webrtc:10335
Change-Id: If725bd498c4c3daf144bee638230fa089fdde833
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256965
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36365}
Diffstat (limited to 'p2p')
-rw-r--r-- | p2p/BUILD.gn | 4 | ||||
-rw-r--r-- | p2p/base/fake_port_allocator.h | 8 | ||||
-rw-r--r-- | p2p/base/p2p_transport_channel.cc | 10 | ||||
-rw-r--r-- | p2p/base/p2p_transport_channel.h | 13 | ||||
-rw-r--r-- | p2p/base/p2p_transport_channel_unittest.cc | 2 | ||||
-rw-r--r-- | p2p/base/port.cc | 4 | ||||
-rw-r--r-- | p2p/base/port.h | 8 | ||||
-rw-r--r-- | p2p/base/stun_port.cc | 8 | ||||
-rw-r--r-- | p2p/base/stun_port.h | 12 | ||||
-rw-r--r-- | p2p/base/tcp_port.cc | 2 | ||||
-rw-r--r-- | p2p/base/tcp_port.h | 4 | ||||
-rw-r--r-- | p2p/base/transport_description_factory.cc | 2 | ||||
-rw-r--r-- | p2p/base/transport_description_factory.h | 8 | ||||
-rw-r--r-- | p2p/base/turn_port.cc | 9 | ||||
-rw-r--r-- | p2p/base/turn_port.h | 8 | ||||
-rw-r--r-- | p2p/client/basic_port_allocator.cc | 7 | ||||
-rw-r--r-- | p2p/client/basic_port_allocator.h | 14 | ||||
-rw-r--r-- | p2p/client/relay_port_factory_interface.h | 4 |
18 files changed, 61 insertions, 66 deletions
diff --git a/p2p/BUILD.gn b/p2p/BUILD.gn index 0524b56adb..9c2d839296 100644 --- a/p2p/BUILD.gn +++ b/p2p/BUILD.gn @@ -86,12 +86,12 @@ rtc_library("rtc_p2p") { deps = [ "../api:array_view", "../api:async_dns_resolver", + "../api:field_trials_view", "../api:libjingle_peerconnection_api", "../api:packet_socket_factory", "../api:rtc_error", "../api:scoped_refptr", "../api:sequence_checker", - "../api:webrtc_key_value_config", "../api:wrapping_async_dns_resolver", "../api/crypto:options", "../api/rtc_event_log", @@ -239,11 +239,11 @@ if (rtc_include_tests) { ":p2p_server_utils", ":p2p_test_utils", ":rtc_p2p", + "../api:field_trials_view", "../api:libjingle_peerconnection_api", "../api:mock_async_dns_resolver", "../api:packet_socket_factory", "../api:scoped_refptr", - "../api:webrtc_key_value_config", "../api/transport:stun_types", "../api/units:time_delta", "../rtc_base", diff --git a/p2p/base/fake_port_allocator.h b/p2p/base/fake_port_allocator.h index 3d93b07662..59533faab0 100644 --- a/p2p/base/fake_port_allocator.h +++ b/p2p/base/fake_port_allocator.h @@ -38,7 +38,7 @@ class TestUDPPort : public UDPPort { const std::string& username, const std::string& password, bool emit_localhost_for_anyaddress, - const webrtc::WebRtcKeyValueConfig* field_trials) { + const webrtc::FieldTrialsView* field_trials) { TestUDPPort* port = new TestUDPPort(thread, factory, network, min_port, max_port, username, password, emit_localhost_for_anyaddress, field_trials); @@ -58,7 +58,7 @@ class TestUDPPort : public UDPPort { const std::string& username, const std::string& password, bool emit_localhost_for_anyaddress, - const webrtc::WebRtcKeyValueConfig* field_trials) + const webrtc::FieldTrialsView* field_trials) : UDPPort(thread, factory, network, @@ -82,7 +82,7 @@ class FakePortAllocatorSession : public PortAllocatorSession { int component, const std::string& ice_ufrag, const std::string& ice_pwd, - const webrtc::WebRtcKeyValueConfig& field_trials) + const webrtc::FieldTrialsView& field_trials) : PortAllocatorSession(content_name, component, ice_ufrag, @@ -207,7 +207,7 @@ class FakePortAllocatorSession : public PortAllocatorSession { uint32_t candidate_filter_ = CF_ALL; int transport_info_update_count_ = 0; bool running_ = false; - const webrtc::WebRtcKeyValueConfig& field_trials_; + const webrtc::FieldTrialsView& field_trials_; }; class FakePortAllocator : public cricket::PortAllocator { diff --git a/p2p/base/p2p_transport_channel.cc b/p2p/base/p2p_transport_channel.cc index a8d84b987d..1daec120d9 100644 --- a/p2p/base/p2p_transport_channel.cc +++ b/p2p/base/p2p_transport_channel.cc @@ -24,8 +24,8 @@ #include "absl/strings/match.h" #include "api/async_dns_resolver.h" #include "api/candidate.h" +#include "api/field_trials_view.h" #include "api/task_queue/queued_task.h" -#include "api/webrtc_key_value_config.h" #include "logging/rtc_event_log/ice_logger.h" #include "p2p/base/basic_async_resolver_factory.h" #include "p2p/base/basic_ice_controller.h" @@ -61,7 +61,7 @@ cricket::PortInterface::CandidateOrigin GetOrigin( } uint32_t GetWeakPingIntervalInFieldTrial( - const webrtc::WebRtcKeyValueConfig* field_trials) { + const webrtc::FieldTrialsView* field_trials) { if (field_trials != nullptr) { uint32_t weak_ping_interval = ::strtoul(field_trials->Lookup("WebRTC-StunInterPacketDelay").c_str(), @@ -134,7 +134,7 @@ P2PTransportChannel::P2PTransportChannel( const std::string& transport_name, int component, PortAllocator* allocator, - const webrtc::WebRtcKeyValueConfig* field_trials) + const webrtc::FieldTrialsView* field_trials) : P2PTransportChannel(transport_name, component, allocator, @@ -154,7 +154,7 @@ P2PTransportChannel::P2PTransportChannel( owned_dns_resolver_factory, webrtc::RtcEventLog* event_log, IceControllerFactoryInterface* ice_controller_factory, - const webrtc::WebRtcKeyValueConfig* field_trials) + const webrtc::FieldTrialsView* field_trials) : transport_name_(transport_name), component_(component), allocator_(allocator), @@ -709,7 +709,7 @@ void P2PTransportChannel::SetIceConfig(const IceConfig& config) { } void P2PTransportChannel::ParseFieldTrials( - const webrtc::WebRtcKeyValueConfig* field_trials) { + const webrtc::FieldTrialsView* field_trials) { if (field_trials == nullptr) { return; } diff --git a/p2p/base/p2p_transport_channel.h b/p2p/base/p2p_transport_channel.h index 24c4b85b8c..4f0ac02a2b 100644 --- a/p2p/base/p2p_transport_channel.h +++ b/p2p/base/p2p_transport_channel.h @@ -111,11 +111,10 @@ class RTC_EXPORT P2PTransportChannel : public IceTransportInternal { // For testing only. // TODO(zstein): Remove once AsyncDnsResolverFactory is required. - P2PTransportChannel( - const std::string& transport_name, - int component, - PortAllocator* allocator, - const webrtc::WebRtcKeyValueConfig* field_trials = nullptr); + P2PTransportChannel(const std::string& transport_name, + int component, + PortAllocator* allocator, + const webrtc::FieldTrialsView* field_trials = nullptr); ~P2PTransportChannel() override; @@ -248,7 +247,7 @@ class RTC_EXPORT P2PTransportChannel : public IceTransportInternal { owned_dns_resolver_factory, webrtc::RtcEventLog* event_log, IceControllerFactoryInterface* ice_controller_factory, - const webrtc::WebRtcKeyValueConfig* field_trials); + const webrtc::FieldTrialsView* field_trials); bool IsGettingPorts() { RTC_DCHECK_RUN_ON(network_thread_); return allocator_session()->IsGettingPorts(); @@ -400,7 +399,7 @@ class RTC_EXPORT P2PTransportChannel : public IceTransportInternal { int64_t ComputeEstimatedDisconnectedTimeMs(int64_t now, Connection* old_connection); - void ParseFieldTrials(const webrtc::WebRtcKeyValueConfig* field_trials); + void ParseFieldTrials(const webrtc::FieldTrialsView* field_trials); webrtc::ScopedTaskSafety task_safety_; std::string transport_name_ RTC_GUARDED_BY(network_thread_); diff --git a/p2p/base/p2p_transport_channel_unittest.cc b/p2p/base/p2p_transport_channel_unittest.cc index c69530b0ef..04d4850b1e 100644 --- a/p2p/base/p2p_transport_channel_unittest.cc +++ b/p2p/base/p2p_transport_channel_unittest.cc @@ -4929,7 +4929,7 @@ class P2PTransportChannelMostLikelyToWorkFirstTest P2PTransportChannel& StartTransportChannel( bool prioritize_most_likely_to_work, int stable_writable_connection_ping_interval, - const webrtc::WebRtcKeyValueConfig* field_trials = nullptr) { + const webrtc::FieldTrialsView* field_trials = nullptr) { channel_.reset( new P2PTransportChannel("checks", 1, allocator(), field_trials)); IceConfig config = channel_->config(); diff --git a/p2p/base/port.cc b/p2p/base/port.cc index 72f4efb0d9..74db59de9d 100644 --- a/p2p/base/port.cc +++ b/p2p/base/port.cc @@ -111,7 +111,7 @@ Port::Port(rtc::Thread* thread, const rtc::Network* network, const std::string& username_fragment, const std::string& password, - const webrtc::WebRtcKeyValueConfig* field_trials) + const webrtc::FieldTrialsView* field_trials) : thread_(thread), factory_(factory), type_(type), @@ -142,7 +142,7 @@ Port::Port(rtc::Thread* thread, uint16_t max_port, const std::string& username_fragment, const std::string& password, - const webrtc::WebRtcKeyValueConfig* field_trials) + const webrtc::FieldTrialsView* field_trials) : thread_(thread), factory_(factory), type_(type), diff --git a/p2p/base/port.h b/p2p/base/port.h index 343170f3a6..747700cffb 100644 --- a/p2p/base/port.h +++ b/p2p/base/port.h @@ -20,11 +20,11 @@ #include "absl/types/optional.h" #include "api/candidate.h" +#include "api/field_trials_view.h" #include "api/packet_socket_factory.h" #include "api/rtc_error.h" #include "api/transport/field_trial_based_config.h" #include "api/transport/stun.h" -#include "api/webrtc_key_value_config.h" #include "logging/rtc_event_log/events/rtc_event_ice_candidate_pair.h" #include "logging/rtc_event_log/events/rtc_event_ice_candidate_pair_config.h" #include "logging/rtc_event_log/ice_logger.h" @@ -189,7 +189,7 @@ class Port : public PortInterface, const rtc::Network* network, const std::string& username_fragment, const std::string& password, - const webrtc::WebRtcKeyValueConfig* field_trials = nullptr); + const webrtc::FieldTrialsView* field_trials = nullptr); Port(rtc::Thread* thread, const std::string& type, rtc::PacketSocketFactory* factory, @@ -198,7 +198,7 @@ class Port : public PortInterface, uint16_t max_port, const std::string& username_fragment, const std::string& password, - const webrtc::WebRtcKeyValueConfig* field_trials = nullptr); + const webrtc::FieldTrialsView* field_trials = nullptr); ~Port() override; // Note that the port type does NOT uniquely identify different subclasses of @@ -499,7 +499,7 @@ class Port : public PortInterface, MdnsNameRegistrationStatus::kNotStarted; rtc::WeakPtrFactory<Port> weak_factory_; - webrtc::AlwaysValidPointer<const webrtc::WebRtcKeyValueConfig, + webrtc::AlwaysValidPointer<const webrtc::FieldTrialsView, webrtc::FieldTrialBasedConfig> field_trials_; diff --git a/p2p/base/stun_port.cc b/p2p/base/stun_port.cc index 46052a0ae8..1dfab8f229 100644 --- a/p2p/base/stun_port.cc +++ b/p2p/base/stun_port.cc @@ -158,7 +158,7 @@ UDPPort::UDPPort(rtc::Thread* thread, const std::string& username, const std::string& password, bool emit_local_for_anyaddress, - const webrtc::WebRtcKeyValueConfig* field_trials) + const webrtc::FieldTrialsView* field_trials) : Port(thread, LOCAL_PORT_TYPE, factory, @@ -182,7 +182,7 @@ UDPPort::UDPPort(rtc::Thread* thread, const std::string& username, const std::string& password, bool emit_local_for_anyaddress, - const webrtc::WebRtcKeyValueConfig* field_trials) + const webrtc::FieldTrialsView* field_trials) : Port(thread, LOCAL_PORT_TYPE, factory, @@ -615,7 +615,7 @@ std::unique_ptr<StunPort> StunPort::Create( const std::string& password, const ServerAddresses& servers, absl::optional<int> stun_keepalive_interval, - const webrtc::WebRtcKeyValueConfig* field_trials) { + const webrtc::FieldTrialsView* field_trials) { // Using `new` to access a non-public constructor. auto port = absl::WrapUnique(new StunPort(thread, factory, network, min_port, max_port, username, password, @@ -635,7 +635,7 @@ StunPort::StunPort(rtc::Thread* thread, const std::string& username, const std::string& password, const ServerAddresses& servers, - const webrtc::WebRtcKeyValueConfig* field_trials) + const webrtc::FieldTrialsView* field_trials) : UDPPort(thread, factory, network, diff --git a/p2p/base/stun_port.h b/p2p/base/stun_port.h index 485fca8b27..de40745c3f 100644 --- a/p2p/base/stun_port.h +++ b/p2p/base/stun_port.h @@ -41,7 +41,7 @@ class UDPPort : public Port { const std::string& password, bool emit_local_for_anyaddress, absl::optional<int> stun_keepalive_interval, - const webrtc::WebRtcKeyValueConfig* field_trials = nullptr) { + const webrtc::FieldTrialsView* field_trials = nullptr) { // Using `new` to access a non-public constructor. auto port = absl::WrapUnique( new UDPPort(thread, factory, network, socket, username, password, @@ -63,7 +63,7 @@ class UDPPort : public Port { const std::string& password, bool emit_local_for_anyaddress, absl::optional<int> stun_keepalive_interval, - const webrtc::WebRtcKeyValueConfig* field_trials = nullptr) { + const webrtc::FieldTrialsView* field_trials = nullptr) { // Using `new` to access a non-public constructor. auto port = absl::WrapUnique( new UDPPort(thread, factory, network, min_port, max_port, username, @@ -127,7 +127,7 @@ class UDPPort : public Port { const std::string& username, const std::string& password, bool emit_local_for_anyaddress, - const webrtc::WebRtcKeyValueConfig* field_trials); + const webrtc::FieldTrialsView* field_trials); UDPPort(rtc::Thread* thread, rtc::PacketSocketFactory* factory, @@ -136,7 +136,7 @@ class UDPPort : public Port { const std::string& username, const std::string& password, bool emit_local_for_anyaddress, - const webrtc::WebRtcKeyValueConfig* field_trials); + const webrtc::FieldTrialsView* field_trials); bool Init(); @@ -275,7 +275,7 @@ class StunPort : public UDPPort { const std::string& password, const ServerAddresses& servers, absl::optional<int> stun_keepalive_interval, - const webrtc::WebRtcKeyValueConfig* field_trials); + const webrtc::FieldTrialsView* field_trials); void PrepareAddress() override; @@ -288,7 +288,7 @@ class StunPort : public UDPPort { const std::string& username, const std::string& password, const ServerAddresses& servers, - const webrtc::WebRtcKeyValueConfig* field_trials); + const webrtc::FieldTrialsView* field_trials); }; } // namespace cricket diff --git a/p2p/base/tcp_port.cc b/p2p/base/tcp_port.cc index 8278ef05e0..1bbc9e93c0 100644 --- a/p2p/base/tcp_port.cc +++ b/p2p/base/tcp_port.cc @@ -92,7 +92,7 @@ TCPPort::TCPPort(rtc::Thread* thread, const std::string& username, const std::string& password, bool allow_listen, - const webrtc::WebRtcKeyValueConfig* field_trials) + const webrtc::FieldTrialsView* field_trials) : Port(thread, LOCAL_PORT_TYPE, factory, diff --git a/p2p/base/tcp_port.h b/p2p/base/tcp_port.h index 80e9a8374f..969d43cb80 100644 --- a/p2p/base/tcp_port.h +++ b/p2p/base/tcp_port.h @@ -43,7 +43,7 @@ class TCPPort : public Port { const std::string& username, const std::string& password, bool allow_listen, - const webrtc::WebRtcKeyValueConfig* field_trials = nullptr) { + const webrtc::FieldTrialsView* field_trials = nullptr) { // Using `new` to access a non-public constructor. return absl::WrapUnique(new TCPPort(thread, factory, network, min_port, max_port, username, password, @@ -74,7 +74,7 @@ class TCPPort : public Port { const std::string& username, const std::string& password, bool allow_listen, - const webrtc::WebRtcKeyValueConfig* field_trials); + const webrtc::FieldTrialsView* field_trials); // Handles sending using the local TCP socket. int SendTo(const void* data, diff --git a/p2p/base/transport_description_factory.cc b/p2p/base/transport_description_factory.cc index 18c4a28c2b..7eb21da166 100644 --- a/p2p/base/transport_description_factory.cc +++ b/p2p/base/transport_description_factory.cc @@ -22,7 +22,7 @@ namespace cricket { TransportDescriptionFactory::TransportDescriptionFactory( - const webrtc::WebRtcKeyValueConfig& field_trials) + const webrtc::FieldTrialsView& field_trials) : secure_(SEC_DISABLED), field_trials_(field_trials) {} TransportDescriptionFactory::~TransportDescriptionFactory() = default; diff --git a/p2p/base/transport_description_factory.h b/p2p/base/transport_description_factory.h index 46f1c2f9fa..b4d8822cd2 100644 --- a/p2p/base/transport_description_factory.h +++ b/p2p/base/transport_description_factory.h @@ -13,7 +13,7 @@ #include <memory> -#include "api/webrtc_key_value_config.h" +#include "api/field_trials_view.h" #include "p2p/base/ice_credentials_iterator.h" #include "p2p/base/transport_description.h" #include "rtc_base/rtc_certificate.h" @@ -39,7 +39,7 @@ class TransportDescriptionFactory { public: // Default ctor; use methods below to set configuration. explicit TransportDescriptionFactory( - const webrtc::WebRtcKeyValueConfig& field_trials); + const webrtc::FieldTrialsView& field_trials); ~TransportDescriptionFactory(); SecurePolicy secure() const { return secure_; } @@ -75,7 +75,7 @@ class TransportDescriptionFactory { const TransportDescription* current_description, IceCredentialsIterator* ice_credentials) const; - const webrtc::WebRtcKeyValueConfig& trials() const { return field_trials_; } + const webrtc::FieldTrialsView& trials() const { return field_trials_; } private: bool SetSecurityInfo(TransportDescription* description, @@ -83,7 +83,7 @@ class TransportDescriptionFactory { SecurePolicy secure_; rtc::scoped_refptr<rtc::RTCCertificate> certificate_; - const webrtc::WebRtcKeyValueConfig& field_trials_; + const webrtc::FieldTrialsView& field_trials_; }; } // namespace cricket diff --git a/p2p/base/turn_port.cc b/p2p/base/turn_port.cc index d984b6cf59..ddf63faab2 100644 --- a/p2p/base/turn_port.cc +++ b/p2p/base/turn_port.cc @@ -226,7 +226,7 @@ TurnPort::TurnPort(rtc::Thread* thread, const std::vector<std::string>& tls_elliptic_curves, webrtc::TurnCustomizer* customizer, rtc::SSLCertificateVerifier* tls_cert_verifier, - const webrtc::WebRtcKeyValueConfig* field_trials) + const webrtc::FieldTrialsView* field_trials) : Port(thread, RELAY_PORT_TYPE, factory, @@ -266,7 +266,7 @@ TurnPort::TurnPort(rtc::Thread* thread, const std::vector<std::string>& tls_elliptic_curves, webrtc::TurnCustomizer* customizer, rtc::SSLCertificateVerifier* tls_cert_verifier, - const webrtc::WebRtcKeyValueConfig* field_trials) + const webrtc::FieldTrialsView* field_trials) : Port(thread, RELAY_PORT_TYPE, factory, @@ -945,9 +945,8 @@ rtc::DiffServCodePoint TurnPort::StunDscpValue() const { } // static -bool TurnPort::AllowedTurnPort( - int port, - const webrtc::WebRtcKeyValueConfig* field_trials) { +bool TurnPort::AllowedTurnPort(int port, + const webrtc::FieldTrialsView* field_trials) { // Port 53, 80 and 443 are used for existing deployments. // Ports above 1024 are assumed to be OK to use. if (port == 53 || port == 80 || port == 443 || port >= 1024) { diff --git a/p2p/base/turn_port.h b/p2p/base/turn_port.h index 89e6bd64b3..fa76695087 100644 --- a/p2p/base/turn_port.h +++ b/p2p/base/turn_port.h @@ -216,7 +216,7 @@ class TurnPort : public Port { const std::vector<std::string>& tls_elliptic_curves, webrtc::TurnCustomizer* customizer, rtc::SSLCertificateVerifier* tls_cert_verifier = nullptr, - const webrtc::WebRtcKeyValueConfig* field_trials = nullptr); + const webrtc::FieldTrialsView* field_trials = nullptr); TurnPort(rtc::Thread* thread, rtc::PacketSocketFactory* factory, @@ -232,7 +232,7 @@ class TurnPort : public Port { const std::vector<std::string>& tls_elliptic_curves, webrtc::TurnCustomizer* customizer, rtc::SSLCertificateVerifier* tls_cert_verifier = nullptr, - const webrtc::WebRtcKeyValueConfig* field_trials = nullptr); + const webrtc::FieldTrialsView* field_trials = nullptr); // NOTE: This method needs to be accessible for StunPort // return true if entry was created (i.e channel_number consumed). @@ -258,7 +258,7 @@ class TurnPort : public Port { typedef std::set<rtc::SocketAddress> AttemptedServerSet; static bool AllowedTurnPort(int port, - const webrtc::WebRtcKeyValueConfig* field_trials); + const webrtc::FieldTrialsView* field_trials); void OnMessage(rtc::Message* pmsg) override; bool CreateTurnClientSocket(); @@ -364,7 +364,7 @@ class TurnPort : public Port { // must outlive the TurnPort's lifetime. webrtc::TurnCustomizer* turn_customizer_ = nullptr; - const webrtc::WebRtcKeyValueConfig* field_trials_; + const webrtc::FieldTrialsView* field_trials_; // Optional TurnLoggingId. // An identifier set by application that is added to TURN_ALLOCATE_REQUEST diff --git a/p2p/client/basic_port_allocator.cc b/p2p/client/basic_port_allocator.cc index 10d855cdc7..8b4bf57ee7 100644 --- a/p2p/client/basic_port_allocator.cc +++ b/p2p/client/basic_port_allocator.cc @@ -253,9 +253,8 @@ void BasicPortAllocator::AddTurnServer(const RelayServerConfig& turn_server) { turn_port_prune_policy(), turn_customizer()); } -void BasicPortAllocator::Init( - RelayPortFactoryInterface* relay_port_factory, - const webrtc::WebRtcKeyValueConfig* field_trials) { +void BasicPortAllocator::Init(RelayPortFactoryInterface* relay_port_factory, + const webrtc::FieldTrialsView* field_trials) { if (relay_port_factory != nullptr) { relay_port_factory_ = relay_port_factory; } else { @@ -1686,7 +1685,7 @@ PortConfiguration::PortConfiguration( const ServerAddresses& stun_servers, const std::string& username, const std::string& password, - const webrtc::WebRtcKeyValueConfig* field_trials) + const webrtc::FieldTrialsView* field_trials) : stun_servers(stun_servers), username(username), password(password) { if (!stun_servers.empty()) stun_address = *(stun_servers.begin()); diff --git a/p2p/client/basic_port_allocator.h b/p2p/client/basic_port_allocator.h index 6d650f5c53..01d07e76b3 100644 --- a/p2p/client/basic_port_allocator.h +++ b/p2p/client/basic_port_allocator.h @@ -15,8 +15,8 @@ #include <string> #include <vector> +#include "api/field_trials_view.h" #include "api/turn_customizer.h" -#include "api/webrtc_key_value_config.h" #include "p2p/base/port_allocator.h" #include "p2p/client/relay_port_factory_interface.h" #include "p2p/client/turn_port_factory.h" @@ -81,9 +81,7 @@ class RTC_EXPORT BasicPortAllocator : public PortAllocator { void SetVpnList(const std::vector<rtc::NetworkMask>& vpn_list) override; - const webrtc::WebRtcKeyValueConfig* field_trials() const { - return field_trials_; - } + const webrtc::FieldTrialsView* field_trials() const { return field_trials_; } private: void OnIceRegathering(PortAllocatorSession* session, @@ -92,12 +90,12 @@ class RTC_EXPORT BasicPortAllocator : public PortAllocator { // This function makes sure that relay_port_factory_ and field_trials_ is set // properly. void Init(RelayPortFactoryInterface* relay_port_factory, - const webrtc::WebRtcKeyValueConfig* field_trials); + const webrtc::FieldTrialsView* field_trials); bool MdnsObfuscationEnabled() const override; - const webrtc::WebRtcKeyValueConfig* field_trials_; - std::unique_ptr<webrtc::WebRtcKeyValueConfig> owned_field_trials_; + const webrtc::FieldTrialsView* field_trials_; + std::unique_ptr<webrtc::FieldTrialsView> owned_field_trials_; rtc::NetworkManager* network_manager_; rtc::PacketSocketFactory* socket_factory_; int network_ignore_mask_ = rtc::kDefaultNetworkIgnoreMask; @@ -310,7 +308,7 @@ struct RTC_EXPORT PortConfiguration { PortConfiguration(const ServerAddresses& stun_servers, const std::string& username, const std::string& password, - const webrtc::WebRtcKeyValueConfig* field_trials = nullptr); + const webrtc::FieldTrialsView* field_trials = nullptr); // Returns addresses of both the explicitly configured STUN servers, // and TURN servers that should be used as STUN servers. diff --git a/p2p/client/relay_port_factory_interface.h b/p2p/client/relay_port_factory_interface.h index 7d63facc06..4eec5dbf28 100644 --- a/p2p/client/relay_port_factory_interface.h +++ b/p2p/client/relay_port_factory_interface.h @@ -26,7 +26,7 @@ class Thread; namespace webrtc { class TurnCustomizer; -class WebRtcKeyValueConfig; +class FieldTrialsView; } // namespace webrtc namespace cricket { @@ -44,7 +44,7 @@ struct CreateRelayPortArgs { std::string username; std::string password; webrtc::TurnCustomizer* turn_customizer = nullptr; - const webrtc::WebRtcKeyValueConfig* field_trials = nullptr; + const webrtc::FieldTrialsView* field_trials = nullptr; }; // A factory for creating RelayPort's. |