mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Mark cricket port type constants as deprecated
...and remove remaining references to them Bug: webrtc:15846 Change-Id: Ica41c0d3cf7bc8698749a5ddb4b8f90a0c8c1162 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/343784 Reviewed-by: Björn Terelius <terelius@webrtc.org> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#41968}
This commit is contained in:
parent
784af1f42e
commit
d1e577dd80
4 changed files with 10 additions and 24 deletions
|
@ -37,11 +37,6 @@ absl::string_view IceCandidateTypeToString(IceCandidateType type) {
|
|||
|
||||
namespace cricket {
|
||||
|
||||
ABSL_CONST_INIT const absl::string_view LOCAL_PORT_TYPE = "local";
|
||||
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";
|
||||
|
||||
Candidate::Candidate()
|
||||
: id_(rtc::CreateRandomString(8)),
|
||||
component_(ICE_CANDIDATE_COMPONENT_DEFAULT),
|
||||
|
|
|
@ -31,12 +31,16 @@ RTC_EXPORT absl::string_view IceCandidateTypeToString(IceCandidateType);
|
|||
|
||||
namespace cricket {
|
||||
|
||||
// TODO(tommi): These are temporarily here, moved from `port.h` and will
|
||||
// eventually be removed once we use enums instead of strings for these values.
|
||||
RTC_EXPORT extern const absl::string_view LOCAL_PORT_TYPE;
|
||||
RTC_EXPORT extern const absl::string_view STUN_PORT_TYPE;
|
||||
RTC_EXPORT extern const absl::string_view PRFLX_PORT_TYPE;
|
||||
RTC_EXPORT extern const absl::string_view RELAY_PORT_TYPE;
|
||||
// TODO(tommi): Remove. No usage in WebRTC now, remove once downstream projects
|
||||
// don't have reliance.
|
||||
[[deprecated("Use IceCandidateType")]] static constexpr char LOCAL_PORT_TYPE[] =
|
||||
"local";
|
||||
[[deprecated("Use IceCandidateType")]] static constexpr char STUN_PORT_TYPE[] =
|
||||
"stun";
|
||||
[[deprecated("Use IceCandidateType")]] static constexpr char PRFLX_PORT_TYPE[] =
|
||||
"prflx";
|
||||
[[deprecated("Use IceCandidateType")]] static constexpr char RELAY_PORT_TYPE[] =
|
||||
"relay";
|
||||
|
||||
// TURN servers are limited to 32 in accordance with
|
||||
// https://w3c.github.io/webrtc-pc/#dom-rtcconfiguration-iceservers
|
||||
|
|
|
@ -89,17 +89,6 @@ absl::optional<ProtocolType> StringToProto(absl::string_view proto_name) {
|
|||
return absl::nullopt;
|
||||
}
|
||||
|
||||
IceCandidateType PortTypeToIceCandidateType(const absl::string_view type) {
|
||||
if (type == "host" || type == LOCAL_PORT_TYPE)
|
||||
return IceCandidateType::kHost;
|
||||
if (type == "srflx" || type == STUN_PORT_TYPE)
|
||||
return IceCandidateType::kSrflx;
|
||||
if (type == PRFLX_PORT_TYPE)
|
||||
return IceCandidateType::kPrflx;
|
||||
RTC_DCHECK_EQ(type, RELAY_PORT_TYPE);
|
||||
return IceCandidateType::kRelay;
|
||||
}
|
||||
|
||||
// RFC 6544, TCP candidate encoding rules.
|
||||
const int DISCARD_PORT = 9;
|
||||
const char TCPTYPE_ACTIVE_STR[] = "active";
|
||||
|
|
|
@ -122,8 +122,6 @@ typedef std::vector<CandidateStats> CandidateStatsList;
|
|||
|
||||
const char* ProtoToString(ProtocolType proto);
|
||||
absl::optional<ProtocolType> StringToProto(absl::string_view proto_name);
|
||||
webrtc::IceCandidateType PortTypeToIceCandidateType(
|
||||
const absl::string_view type);
|
||||
|
||||
struct ProtocolAddress {
|
||||
rtc::SocketAddress address;
|
||||
|
|
Loading…
Reference in a new issue