summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/api/candidate.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /third_party/libwebrtc/api/candidate.cc
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--third_party/libwebrtc/api/candidate.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/third_party/libwebrtc/api/candidate.cc b/third_party/libwebrtc/api/candidate.cc
index 90cb326823..865f8e5787 100644
--- a/third_party/libwebrtc/api/candidate.cc
+++ b/third_party/libwebrtc/api/candidate.cc
@@ -17,6 +17,11 @@
namespace cricket {
+const char LOCAL_PORT_TYPE[] = "local";
+const char STUN_PORT_TYPE[] = "stun";
+const char PRFLX_PORT_TYPE[] = "prflx";
+const char RELAY_PORT_TYPE[] = "relay";
+
Candidate::Candidate()
: id_(rtc::CreateRandomString(8)),
component_(0),
@@ -57,6 +62,19 @@ Candidate::Candidate(const Candidate&) = default;
Candidate::~Candidate() = default;
+bool Candidate::is_local() const {
+ return type_ == LOCAL_PORT_TYPE;
+}
+bool Candidate::is_stun() const {
+ return type_ == STUN_PORT_TYPE;
+}
+bool Candidate::is_prflx() const {
+ return type_ == PRFLX_PORT_TYPE;
+}
+bool Candidate::is_relay() const {
+ return type_ == RELAY_PORT_TYPE;
+}
+
bool Candidate::IsEquivalent(const Candidate& c) const {
// We ignore the network name, since that is just debug information, and
// the priority and the network cost, since they should be the same if the