Add missing method definition for StatsReport::Value::id_val()

Also add a preprocessor definition to avoid redefinition in downstream projects.

Bug: webrtc:15241
Change-Id: Ic55d98c3d3a69b9b19195ee78f03af6e38fdd0e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308601
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Cr-Commit-Position: refs/heads/main@{#40289}
This commit is contained in:
Sameer Vijaykar 2023-06-14 11:21:11 +02:00 committed by WebRTC LUCI CQ
parent 36e37c7de9
commit 51b82067ca
2 changed files with 11 additions and 0 deletions

View File

@ -362,6 +362,11 @@ bool StatsReport::Value::bool_val() const {
return value_.bool_;
}
const StatsReport::Id& StatsReport::Value::id_val() const {
RTC_DCHECK_EQ(type_, kId);
return *value_.id_;
}
const char* StatsReport::Value::display_name() const {
switch (name) {
case kStatsValueNameAecDivergentFilterFraction:

View File

@ -333,6 +333,12 @@ class RTC_EXPORT StatsReport {
bool bool_val() const;
const Id& id_val() const;
// TODO(bugs.webrtc.org/15241): remove this definition once downstream
// definitions of StatsReport::Value::id_val() have been deleted.
#ifndef WEBRTC_DEFINES_STATSREPORT_VALUE_ID_VAL
#define WEBRTC_DEFINES_STATSREPORT_VALUE_ID_VAL
#endif // WEBRTC_DEFINES_STATSREPORT_VALUE_ID_VAL
// Returns the string representation of `name`.
const char* display_name() const;