From 00566ec1d079f115c39f0ec1695a9d12e9912cea Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Tue, 23 Apr 2024 07:45:46 +0000 Subject: [PATCH] Non-inline functions that call CallbackList and are called from Chrome This avoids problems with the Chrome component build. Bug: webrtc:11943 Change-Id: I120628ee7829aa0255e60e2f21ac0608374340b1 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/348723 Reviewed-by: Tomas Gunnarsson Commit-Queue: Harald Alvestrand Cr-Commit-Position: refs/heads/main@{#42146} --- p2p/base/ice_transport_internal.cc | 10 ++++++++++ p2p/base/ice_transport_internal.h | 10 +++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/p2p/base/ice_transport_internal.cc b/p2p/base/ice_transport_internal.cc index 0dc7e50af2..15da627202 100644 --- a/p2p/base/ice_transport_internal.cc +++ b/p2p/base/ice_transport_internal.cc @@ -143,4 +143,14 @@ void IceTransportInternal::SetRemoteIceCredentials(absl::string_view ice_ufrag, SetRemoteIceParameters(IceParameters(ice_ufrag, ice_pwd, false)); } +void IceTransportInternal::AddGatheringStateCallback( + const void* removal_tag, + absl::AnyInvocable callback) { + gathering_state_callback_list_.AddReceiver(removal_tag, std::move(callback)); +} +void IceTransportInternal::RemoveGatheringStateCallback( + const void* removal_tag) { + gathering_state_callback_list_.RemoveReceivers(removal_tag); +} + } // namespace cricket diff --git a/p2p/base/ice_transport_internal.h b/p2p/base/ice_transport_internal.h index 32e913de05..78369c09d2 100644 --- a/p2p/base/ice_transport_internal.h +++ b/p2p/base/ice_transport_internal.h @@ -306,15 +306,11 @@ class RTC_EXPORT IceTransportInternal : public rtc::PacketTransportInternal { // Signal Exposed for backwards compatibility. sigslot::signal1 SignalGatheringState; + // Note: These calls must not be inlined in order to avoid linking issues. void AddGatheringStateCallback( const void* removal_tag, - absl::AnyInvocable callback) { - gathering_state_callback_list_.AddReceiver(removal_tag, - std::move(callback)); - } - void RemoveGatheringStateCallback(const void* removal_tag) { - gathering_state_callback_list_.RemoveReceivers(removal_tag); - } + absl::AnyInvocable callback); + void RemoveGatheringStateCallback(const void* removal_tag); // Handles sending and receiving of candidates. sigslot::signal2