summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/stats/attribute.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
commita90a5cba08fdf6c0ceb95101c275108a152a3aed (patch)
tree532507288f3defd7f4dcf1af49698bcb76034855 /third_party/libwebrtc/stats/attribute.cc
parentAdding debian version 126.0.1-1. (diff)
downloadfirefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz
firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/stats/attribute.cc')
-rw-r--r--third_party/libwebrtc/stats/attribute.cc19
1 files changed, 8 insertions, 11 deletions
diff --git a/third_party/libwebrtc/stats/attribute.cc b/third_party/libwebrtc/stats/attribute.cc
index fab948b1bd..cf49cb2311 100644
--- a/third_party/libwebrtc/stats/attribute.cc
+++ b/third_party/libwebrtc/stats/attribute.cc
@@ -25,12 +25,12 @@ namespace {
struct VisitIsSequence {
// Any type of vector is a sequence.
template <typename T>
- bool operator()(const RTCStatsMember<std::vector<T>>* attribute) {
+ bool operator()(const absl::optional<std::vector<T>>* attribute) {
return true;
}
// Any other type is not.
template <typename T>
- bool operator()(const RTCStatsMember<T>* attribute) {
+ bool operator()(const absl::optional<T>* attribute) {
return false;
}
};
@@ -62,7 +62,7 @@ struct VisitToString {
// Vector attributes.
template <typename T>
- std::string operator()(const RTCStatsMember<std::vector<T>>* attribute) {
+ std::string operator()(const absl::optional<std::vector<T>>* attribute) {
rtc::StringBuilder sb;
sb << "[";
const char* separator = "";
@@ -84,7 +84,7 @@ struct VisitToString {
// Map attributes.
template <typename T>
std::string operator()(
- const RTCStatsMember<std::map<std::string, T>>* attribute) {
+ const absl::optional<std::map<std::string, T>>* attribute) {
rtc::StringBuilder sb;
sb << "{";
const char* separator = "";
@@ -106,21 +106,18 @@ struct VisitToString {
}
// Simple attributes.
template <typename T>
- std::string operator()(const RTCStatsMember<T>* attribute) {
+ std::string operator()(const absl::optional<T>* attribute) {
return ValueToString(attribute->value());
}
};
struct VisitIsEqual {
template <typename T>
- bool operator()(const RTCStatsMember<T>* attribute) {
+ bool operator()(const absl::optional<T>* attribute) {
if (!other.holds_alternative<T>()) {
return false;
}
- absl::optional<T> attribute_as_optional =
- attribute->has_value() ? absl::optional<T>(attribute->value())
- : absl::nullopt;
- return attribute_as_optional == other.as_optional<T>();
+ return *attribute == other.as_optional<T>();
}
const Attribute& other;
@@ -146,7 +143,7 @@ bool Attribute::is_sequence() const {
}
bool Attribute::is_string() const {
- return absl::holds_alternative<const RTCStatsMember<std::string>*>(
+ return absl::holds_alternative<const absl::optional<std::string>*>(
attribute_);
}