#include "p2p/base/basic_ice_controller.h"
namespace {
const int kMinImprovement = …;
bool IsRelayRelay(const cricket::Connection* conn) { … }
bool IsUdp(const cricket::Connection* conn) { … }
static constexpr int a_is_better = …;
static constexpr int b_is_better = …;
static constexpr int a_and_b_equal = …;
bool LocalCandidateUsesPreferredNetwork(
const cricket::Connection* conn,
absl::optional<rtc::AdapterType> network_preference) { … }
int CompareCandidatePairsByNetworkPreference(
const cricket::Connection* a,
const cricket::Connection* b,
absl::optional<rtc::AdapterType> network_preference) { … }
}
namespace cricket {
BasicIceController::BasicIceController(const IceControllerFactoryArgs& args)
: … { … }
BasicIceController::~BasicIceController() { … }
void BasicIceController::SetIceConfig(const IceConfig& config) { … }
void BasicIceController::SetSelectedConnection(
const Connection* selected_connection) { … }
void BasicIceController::AddConnection(const Connection* connection) { … }
void BasicIceController::OnConnectionDestroyed(const Connection* connection) { … }
bool BasicIceController::HasPingableConnection() const { … }
IceControllerInterface::PingResult BasicIceController::SelectConnectionToPing(
int64_t last_ping_sent_ms) { … }
void BasicIceController::MarkConnectionPinged(const Connection* conn) { … }
const Connection* BasicIceController::FindNextPingableConnection() { … }
const Connection* BasicIceController::FindOldestConnectionNeedingTriggeredCheck(
int64_t now) { … }
bool BasicIceController::WritableConnectionPastPingInterval(
const Connection* conn,
int64_t now) const { … }
int BasicIceController::CalculateActiveWritablePingInterval(
const Connection* conn,
int64_t now) const { … }
bool BasicIceController::IsPingable(const Connection* conn, int64_t now) const { … }
bool BasicIceController::IsBackupConnection(const Connection* conn) const { … }
const Connection* BasicIceController::MorePingable(const Connection* conn1,
const Connection* conn2) { … }
const Connection* BasicIceController::MostLikelyToWork(
const Connection* conn1,
const Connection* conn2) { … }
const Connection* BasicIceController::LeastRecentlyPinged(
const Connection* conn1,
const Connection* conn2) { … }
std::map<const rtc::Network*, const Connection*>
BasicIceController::GetBestConnectionByNetwork() const { … }
std::vector<const Connection*>
BasicIceController::GetBestWritableConnectionPerNetwork() const { … }
IceControllerInterface::SwitchResult
BasicIceController::HandleInitialSelectDampening(
IceSwitchReason reason,
const Connection* new_connection) { … }
IceControllerInterface::SwitchResult BasicIceController::ShouldSwitchConnection(
IceSwitchReason reason,
const Connection* new_connection) { … }
IceControllerInterface::SwitchResult
BasicIceController::SortAndSwitchConnection(IceSwitchReason reason) { … }
bool BasicIceController::ReadyToSend(const Connection* connection) const { … }
bool BasicIceController::PresumedWritable(const Connection* conn) const { … }
int BasicIceController::CompareConnectionStates(
const Connection* a,
const Connection* b,
absl::optional<int64_t> receiving_unchanged_threshold,
bool* missed_receiving_unchanged_threshold) const { … }
int BasicIceController::CompareConnectionCandidates(const Connection* a,
const Connection* b) const { … }
int BasicIceController::CompareConnections(
const Connection* a,
const Connection* b,
absl::optional<int64_t> receiving_unchanged_threshold,
bool* missed_receiving_unchanged_threshold) const { … }
int BasicIceController::CompareCandidatePairNetworks(
const Connection* a,
const Connection* b,
absl::optional<rtc::AdapterType> network_preference) const { … }
std::vector<const Connection*> BasicIceController::PruneConnections() { … }
bool BasicIceController::GetUseCandidateAttr(const Connection* conn,
NominationMode mode,
IceMode remote_ice_mode) const { … }
}