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}
This commit is contained in:
Sameer Vijaykar
2022-05-30 15:26:51 +02:00
committed by WebRTC LUCI CQ
parent 9406c22769
commit 794e68cf3d
10 changed files with 219 additions and 83 deletions

View File

@ -46,9 +46,9 @@ class BasicIceController : public IceControllerInterface {
NominationMode mode,
IceMode remote_ice_mode) const override;
SwitchResult ShouldSwitchConnection(IceControllerEvent reason,
SwitchResult ShouldSwitchConnection(IceSwitchReason reason,
const Connection* connection) override;
SwitchResult SortAndSwitchConnection(IceControllerEvent reason) override;
SwitchResult SortAndSwitchConnection(IceSwitchReason reason) override;
std::vector<const Connection*> PruneConnections() override;
@ -136,7 +136,7 @@ class BasicIceController : public IceControllerInterface {
absl::optional<int64_t> receiving_unchanged_threshold,
bool* missed_receiving_unchanged_threshold) const;
SwitchResult HandleInitialSelectDampening(IceControllerEvent reason,
SwitchResult HandleInitialSelectDampening(IceSwitchReason reason,
const Connection* new_connection);
std::function<IceTransportState()> ice_transport_state_func_;