Sigslot: Declare some signals in IceTransportInternal private
Also add more API for SignalDestroyed, to accommodate
Chromium usage.
Bug: webrtc:42222066
Change-Id: I9ef15816d83378721ce05dac29e77e048f7978f7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/415821
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45898}
diff --git a/p2p/base/ice_transport_internal.cc b/p2p/base/ice_transport_internal.cc
index 48d43cf..c22f382 100644
--- a/p2p/base/ice_transport_internal.cc
+++ b/p2p/base/ice_transport_internal.cc
@@ -282,5 +282,13 @@
absl::AnyInvocable<void(IceTransportInternal*)> callback) {
destroyed_trampoline_.Subscribe(std::move(callback));
}
+void IceTransportInternal::SubscribeDestroyed(
+ void* tag,
+ absl::AnyInvocable<void(IceTransportInternal*)> callback) {
+ destroyed_trampoline_.Subscribe(tag, std::move(callback));
+}
+void IceTransportInternal::UnsubscribeDestroyed(void* tag) {
+ destroyed_trampoline_.Unsubscribe(tag);
+}
} // namespace webrtc
diff --git a/p2p/base/ice_transport_internal.h b/p2p/base/ice_transport_internal.h
index 04f6e35..da45f13 100644
--- a/p2p/base/ice_transport_internal.h
+++ b/p2p/base/ice_transport_internal.h
@@ -382,7 +382,6 @@
// Invoked when there is conflict in the ICE role between local and remote
// agents.
- sigslot::signal1<IceTransportInternal*> SignalRoleConflict;
void NotifyRoleConflict(IceTransportInternal* transport) {
SignalRoleConflict(transport);
}
@@ -390,7 +389,6 @@
absl::AnyInvocable<void(IceTransportInternal*)> callback);
// Emitted whenever the new standards-compliant transport state changed.
- sigslot::signal1<IceTransportInternal*> SignalIceTransportStateChanged;
void NotifyIceTransportStateChanged(IceTransportInternal* transport) {
SignalIceTransportStateChanged(transport);
}
@@ -398,12 +396,18 @@
absl::AnyInvocable<void(IceTransportInternal*)> callback);
// Invoked when the transport is being destroyed.
+ // This signal will be moved to "private" once Chromium
+ // usage has been modified.
sigslot::signal1<IceTransportInternal*> SignalDestroyed;
void NotifyDestroyed(IceTransportInternal* transport) {
SignalDestroyed(transport);
}
void SubscribeDestroyed(
absl::AnyInvocable<void(IceTransportInternal*)> callback);
+ void SubscribeDestroyed(
+ void* tag,
+ absl::AnyInvocable<void(IceTransportInternal*)> callback);
+ void UnsubscribeDestroyed(void* tag);
// Invoked when remote dictionary has been updated,
// i.e. modifications to attributes from remote ice agent has
@@ -454,6 +458,10 @@
candidate_pair_change_callback_;
private:
+ // Slated for replacement with CallbackList.
+ sigslot::signal1<IceTransportInternal*> SignalRoleConflict;
+ sigslot::signal1<IceTransportInternal*> SignalIceTransportStateChanged;
+
CallbackList<IceTransportInternal*, const Candidate&>
candidate_gathered_callbacks_;
SignalTrampoline<IceTransportInternal,