Reland "Refactor IceControllerEvent" 2/n
This is a partial reland of commit 794e68cf3dbc3b16ee8b12b5615d8a1622154dbd
which uses the new enum in P2PTransportChannel and BasicIceController.
Original change's description:
> Refactor IceControllerEvent
>
> This change is the first step in decoupling IceControllerEvent from
> the ICE switch reason. Further cleanup is earmarked, and will be
> landed after some internal cleanup.
>
> This change
> - adds a new enum - IceSwitchReason
> - adds a member for the new enum in IceControllerEvent
> - uses the new enum within P2PTransportChannel
> - adds methods to IceControllerInterface accepting the new enum
> - deprecates usages of the old enum in IceControllerInterface
> - adds conversion between the old and new enums for compatibility
>
> Bug: webrtc:14125, webrtc:14131
> Change-Id: I5b7201c3f631eb40db334dfeec842841a7e58174
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264140
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Commit-Queue: Sameer Vijaykar <samvi@google.com>
> Cr-Commit-Position: refs/heads/main@{#37051}
Bug: webrtc:14125, webrtc:14131
Change-Id: I81b0338ae2f0560cd3df7ad9bd9af37e7c3499df
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264554
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Cr-Commit-Position: refs/heads/main@{#37105}
diff --git a/p2p/base/ice_controller_interface.h b/p2p/base/ice_controller_interface.h
index 52bbd5b..dad2b70 100644
--- a/p2p/base/ice_controller_interface.h
+++ b/p2p/base/ice_controller_interface.h
@@ -42,8 +42,8 @@
ICE_CONTROLLER_RECHECK,
};
- // TODO(bugs.webrtc.org/14125) remove.
- IceControllerEvent(const Type& _type) // NOLINT: runtime/explicit
+ [[deprecated("bugs.webrtc.org/14125")]] IceControllerEvent(
+ const Type& _type) // NOLINT: runtime/explicit
: type(_type), reason(FromType(_type)) {}
IceControllerEvent(IceSwitchReason _reason, int _recheck_delay_ms)
@@ -151,20 +151,21 @@
// Check if we should switch to `connection`.
// This method is called for IceSwitchReasons that can switch directly
// i.e without resorting.
- virtual SwitchResult ShouldSwitchConnection(IceControllerEvent reason,
- const Connection* connection) = 0;
- virtual SwitchResult ShouldSwitchConnection(IceSwitchReason reason,
- const Connection* connection) {
- return ShouldSwitchConnection(
- IceControllerEvent::FromIceSwitchReason(reason), connection);
+ [[deprecated("bugs.webrtc.org/14125")]] virtual SwitchResult
+ ShouldSwitchConnection(IceControllerEvent reason,
+ const Connection* connection) {
+ return ShouldSwitchConnection(IceControllerEvent::FromType(reason.type),
+ connection);
}
+ virtual SwitchResult ShouldSwitchConnection(IceSwitchReason reason,
+ const Connection* connection) = 0;
// Sort connections and check if we should switch.
- virtual SwitchResult SortAndSwitchConnection(IceControllerEvent reason) = 0;
- virtual SwitchResult SortAndSwitchConnection(IceSwitchReason reason) {
- return SortAndSwitchConnection(
- IceControllerEvent::FromIceSwitchReason(reason));
+ [[deprecated("bugs.webrtc.org/14125")]] virtual SwitchResult
+ SortAndSwitchConnection(IceControllerEvent reason) {
+ return SortAndSwitchConnection(IceControllerEvent::FromType(reason.type));
}
+ virtual SwitchResult SortAndSwitchConnection(IceSwitchReason reason) = 0;
// Prune connections.
virtual std::vector<const Connection*> PruneConnections() = 0;