Skip to content

Commit

Permalink
Remove deprecated Candidate methods
Browse files Browse the repository at this point in the history
Bug: webrtc:15846
Change-Id: Iba39a16f6f2b77599996af39216f41121f9b1c24
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342020
Reviewed-by: Harald Alvestrand <[email protected]>
Commit-Queue: Tomas Gunnarsson <[email protected]>
Cr-Commit-Position: refs/heads/main@{#41925}
  • Loading branch information
Tommi authored and WebRTC LUCI CQ committed Mar 19, 2024
1 parent 302c0f8 commit 8ae894d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 62 deletions.
42 changes: 0 additions & 42 deletions api/candidate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down
20 changes: 0 additions & 20 deletions api/candidate.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,30 +57,13 @@ 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();

// 8 character long randomized ID string for logging purposes.
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; }
Expand Down Expand Up @@ -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()`.
Expand Down

0 comments on commit 8ae894d

Please sign in to comment.