Remove deprecated Candidate methods
Bug: webrtc:15846 Change-Id: Iba39a16f6f2b77599996af39216f41121f9b1c24 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342020 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#41925}
This commit is contained in:
parent
302c0f8d06
commit
8ae894d924
@ -42,21 +42,6 @@ ABSL_CONST_INIT const absl::string_view STUN_PORT_TYPE = "stun";
|
||||
ABSL_CONST_INIT const absl::string_view PRFLX_PORT_TYPE = "prflx";
|
||||
ABSL_CONST_INIT const absl::string_view RELAY_PORT_TYPE = "relay";
|
||||
|
||||
namespace {
|
||||
IceCandidateType CandidateTypeFromString(absl::string_view type) {
|
||||
if (type == LOCAL_PORT_TYPE) {
|
||||
return IceCandidateType::kHost;
|
||||
} else if (type == STUN_PORT_TYPE) {
|
||||
return IceCandidateType::kSrflx;
|
||||
} else if (type == PRFLX_PORT_TYPE) {
|
||||
return IceCandidateType::kPrflx;
|
||||
} else {
|
||||
RTC_DCHECK_EQ(type, RELAY_PORT_TYPE);
|
||||
return IceCandidateType::kRelay;
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Candidate::Candidate()
|
||||
: id_(rtc::CreateRandomString(8)),
|
||||
component_(ICE_CANDIDATE_COMPONENT_DEFAULT),
|
||||
@ -93,29 +78,6 @@ Candidate::Candidate(int component,
|
||||
network_id_(network_id),
|
||||
network_cost_(network_cost) {}
|
||||
|
||||
Candidate::Candidate(int component,
|
||||
absl::string_view protocol,
|
||||
const rtc::SocketAddress& address,
|
||||
uint32_t priority,
|
||||
absl::string_view username,
|
||||
absl::string_view password,
|
||||
absl::string_view type,
|
||||
uint32_t generation,
|
||||
absl::string_view foundation,
|
||||
uint16_t network_id,
|
||||
uint16_t network_cost)
|
||||
: Candidate(component,
|
||||
protocol,
|
||||
address,
|
||||
priority,
|
||||
username,
|
||||
password,
|
||||
CandidateTypeFromString(type),
|
||||
generation,
|
||||
foundation,
|
||||
network_id,
|
||||
network_cost) {}
|
||||
|
||||
Candidate::Candidate(const Candidate&) = default;
|
||||
|
||||
Candidate::~Candidate() = default;
|
||||
@ -124,10 +86,6 @@ void Candidate::generate_id() {
|
||||
id_ = rtc::CreateRandomString(8);
|
||||
}
|
||||
|
||||
void Candidate::set_type(absl::string_view type ABSL_ATTRIBUTE_LIFETIME_BOUND) {
|
||||
set_type(CandidateTypeFromString(type));
|
||||
}
|
||||
|
||||
bool Candidate::is_local() const {
|
||||
return type_ == IceCandidateType::kHost;
|
||||
}
|
||||
|
||||
@ -57,18 +57,6 @@ class RTC_EXPORT Candidate {
|
||||
absl::string_view foundation,
|
||||
uint16_t network_id = 0,
|
||||
uint16_t network_cost = 0);
|
||||
[[deprecated("Use IceCandidateType version")]] Candidate(
|
||||
int component,
|
||||
absl::string_view protocol,
|
||||
const rtc::SocketAddress& address,
|
||||
uint32_t priority,
|
||||
absl::string_view username,
|
||||
absl::string_view password,
|
||||
absl::string_view type ABSL_ATTRIBUTE_LIFETIME_BOUND,
|
||||
uint32_t generation,
|
||||
absl::string_view foundation,
|
||||
uint16_t network_id = 0,
|
||||
uint16_t network_cost = 0);
|
||||
Candidate(const Candidate&);
|
||||
~Candidate();
|
||||
|
||||
@ -76,11 +64,6 @@ class RTC_EXPORT Candidate {
|
||||
const std::string& id() const { return id_; }
|
||||
// Generates a new, 8 character long, id.
|
||||
void generate_id();
|
||||
// TODO(tommi): Callers should use generate_id(). Remove.
|
||||
[[deprecated("Use IceCandidateType version")]] void set_id(
|
||||
absl::string_view id) {
|
||||
Assign(id_, id);
|
||||
}
|
||||
|
||||
int component() const { return component_; }
|
||||
void set_component(int component) { component_ = component; }
|
||||
@ -127,9 +110,6 @@ class RTC_EXPORT Candidate {
|
||||
// things down. See also the `Port` class.
|
||||
void set_type(webrtc::IceCandidateType type) { type_ = type; }
|
||||
|
||||
[[deprecated("Use IceCandidateType version")]] void set_type(
|
||||
absl::string_view type ABSL_ATTRIBUTE_LIFETIME_BOUND);
|
||||
|
||||
// Simple checkers for checking the candidate type without dependency on the
|
||||
// IceCandidateType enum. The `is_local()` and `is_stun()` names are legacy
|
||||
// names and should now more accurately be `is_host()` and `is_srflx()`.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user