diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /third_party/libwebrtc/api/candidate.h | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/api/candidate.h')
-rw-r--r-- | third_party/libwebrtc/api/candidate.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/third_party/libwebrtc/api/candidate.h b/third_party/libwebrtc/api/candidate.h index d48f4fc559..0aa75aa192 100644 --- a/third_party/libwebrtc/api/candidate.h +++ b/third_party/libwebrtc/api/candidate.h @@ -24,14 +24,18 @@ #include "rtc_base/socket_address.h" #include "rtc_base/system/rtc_export.h" +namespace webrtc { +enum class IceCandidateType : int { kHost, kSrflx, kPrflx, kRelay }; +} // namespace webrtc + 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 char LOCAL_PORT_TYPE[]; -RTC_EXPORT extern const char STUN_PORT_TYPE[]; -RTC_EXPORT extern const char PRFLX_PORT_TYPE[]; -RTC_EXPORT extern const char RELAY_PORT_TYPE[]; +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; // TURN servers are limited to 32 in accordance with // https://w3c.github.io/webrtc-pc/#dom-rtcconfiguration-iceservers @@ -59,8 +63,12 @@ class RTC_EXPORT Candidate { Candidate(const Candidate&); ~Candidate(); + // 8 character long randomized ID string for logging purposes. const std::string& id() const { return id_; } - void set_id(absl::string_view id) { Assign(id_, id); } + // Generates a new, 8 character long, id. + void generate_id(); + // TODO(tommi): Callers should use generate_id(). Remove. + [[deprecated]] void set_id(absl::string_view id) { Assign(id_, id); } int component() const { return component_; } void set_component(int component) { component_ = component; } @@ -89,6 +97,10 @@ class RTC_EXPORT Candidate { const std::string& type() const { return type_; } + // Returns the name of the candidate type as specified in + // https://datatracker.ietf.org/doc/html/rfc5245#section-15.1 + absl::string_view type_name() const; + // Setting the type requires a constant string (e.g. // cricket::LOCAL_PORT_TYPE). The type should really be an enum rather than a // string, but until we make that change the lifetime attribute helps us lock |