diff --git a/p2p/base/basic_ice_controller.h b/p2p/base/basic_ice_controller.h index b941a0dd7e..724609d2d7 100644 --- a/p2p/base/basic_ice_controller.h +++ b/p2p/base/basic_ice_controller.h @@ -32,6 +32,9 @@ class BasicIceController : public IceControllerInterface { void SetSelectedConnection(const Connection* selected_connection) override; void AddConnection(const Connection* connection) override; void OnConnectionDestroyed(const Connection* connection) override; + rtc::ArrayView GetConnections() const override { + return connections_; + } rtc::ArrayView connections() const override { return rtc::ArrayView( const_cast(connections_.data()), diff --git a/p2p/base/ice_controller_interface.h b/p2p/base/ice_controller_interface.h index 8b63ed3fc3..fb421cf0f9 100644 --- a/p2p/base/ice_controller_interface.h +++ b/p2p/base/ice_controller_interface.h @@ -19,6 +19,7 @@ #include "p2p/base/connection.h" #include "p2p/base/ice_switch_reason.h" #include "p2p/base/ice_transport_internal.h" +#include "rtc_base/checks.h" #include "rtc_base/system/rtc_export.h" namespace cricket { @@ -53,7 +54,7 @@ struct RTC_EXPORT IceRecheckEvent { // Connection::ForgetLearnedState - return in SwitchResult // // The IceController shall keep track of all connections added -// (and not destroyed) and give them back using the connections()-function- +// (and not destroyed) and give them back using the GetConnections() function. // // When a Connection gets destroyed // - signals on Connection::SignalDestroyed @@ -101,7 +102,17 @@ class IceControllerInterface { virtual void OnConnectionDestroyed(const Connection* connection) = 0; // These are all connections that has been added and not destroyed. - virtual rtc::ArrayView connections() const = 0; + virtual rtc::ArrayView GetConnections() const { + // Stub implementation to simplify downstream roll. + RTC_CHECK_NOTREACHED(); + return {}; + } + // TODO(bugs.webrtc.org/15702): Remove this after downstream is cleaned up. + virtual rtc::ArrayView connections() const { + // Stub implementation to simplify downstream removal. + RTC_CHECK_NOTREACHED(); + return {}; + } // Is there a pingable connection ? // This function is used to boot-strap pinging, after this returns true diff --git a/p2p/base/mock_ice_controller.h b/p2p/base/mock_ice_controller.h index bde9254e7d..f552519be0 100644 --- a/p2p/base/mock_ice_controller.h +++ b/p2p/base/mock_ice_controller.h @@ -35,6 +35,10 @@ class MockIceController : public cricket::IceControllerInterface { OnConnectionDestroyed, (const cricket::Connection*), (override)); + MOCK_METHOD(rtc::ArrayView, + GetConnections, + (), + (const, override)); MOCK_METHOD(rtc::ArrayView, connections, (),