diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /third_party/libwebrtc/api/stats/rtc_stats.h | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/api/stats/rtc_stats.h')
-rw-r--r-- | third_party/libwebrtc/api/stats/rtc_stats.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/third_party/libwebrtc/api/stats/rtc_stats.h b/third_party/libwebrtc/api/stats/rtc_stats.h index edd293f5c9..74e7fc4d8e 100644 --- a/third_party/libwebrtc/api/stats/rtc_stats.h +++ b/third_party/libwebrtc/api/stats/rtc_stats.h @@ -20,8 +20,8 @@ #include <utility> #include <vector> +#include "absl/types/optional.h" #include "api/stats/attribute.h" -#include "api/stats/rtc_stats_member.h" #include "api/units/timestamp.h" #include "rtc_base/checks.h" #include "rtc_base/system/rtc_export.h" @@ -39,8 +39,8 @@ namespace webrtc { // Use the `WEBRTC_RTCSTATS_IMPL` macro when implementing subclasses, see macro // for details. // -// Derived classes list their dictionary attributes (RTCStatsMember<T> to soon -// be replaced by absl::optional<T>) as public fields, allowing the following: +// Derived classes list their dictionary attributes, absl::optional<T>, as +// public fields, allowing the following: // // RTCFooStats foo("fooId", Timestamp::Micros(GetCurrentTime())); // foo.bar = 42; @@ -52,7 +52,7 @@ namespace webrtc { // iteration: // // for (const auto& attribute : foo.Attributes()) { -// printf("%s = %s\n", attribute.name(), attribute.ValueToString().c_str()); +// printf("%s = %s\n", attribute.name(), attribute.ToString().c_str()); // } class RTC_EXPORT RTCStats { public: @@ -73,12 +73,12 @@ class RTC_EXPORT RTCStats { // metrics as viewed via the Attribute wrapper. std::vector<Attribute> Attributes() const; template <typename T> - Attribute GetAttribute(const RTCStatsMember<T>& stat) const { + Attribute GetAttribute(const absl::optional<T>& stat) const { for (const auto& attribute : Attributes()) { if (!attribute.holds_alternative<T>()) { continue; } - if (absl::get<const RTCStatsMember<T>*>(attribute.as_variant()) == + if (absl::get<const absl::optional<T>*>(attribute.as_variant()) == &stat) { return attribute; } @@ -136,8 +136,8 @@ class RTC_EXPORT RTCStats { // // RTCFooStats(const std::string& id, Timestamp timestamp); // -// RTCStatsMember<int32_t> foo; -// RTCStatsMember<int32_t> bar; +// absl::optional<int32_t> foo; +// absl::optional<int32_t> bar; // }; // // rtcfoostats.cc: |