Skip to content

Commit 51b8206

Browse files
sam-viWebRTC LUCI CQ
authored andcommitted
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 <[email protected]> Reviewed-by: Henrik Boström <[email protected]> Reviewed-by: Jonas Oreland <[email protected]> Commit-Queue: Sameer Vijaykar <[email protected]> Cr-Commit-Position: refs/heads/main@{#40289}
1 parent 36e37c7 commit 51b8206

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

api/legacy_stats_types.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,11 @@ bool StatsReport::Value::bool_val() const {
362362
return value_.bool_;
363363
}
364364

365+
const StatsReport::Id& StatsReport::Value::id_val() const {
366+
RTC_DCHECK_EQ(type_, kId);
367+
return *value_.id_;
368+
}
369+
365370
const char* StatsReport::Value::display_name() const {
366371
switch (name) {
367372
case kStatsValueNameAecDivergentFilterFraction:

api/legacy_stats_types.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,12 @@ class RTC_EXPORT StatsReport {
333333
bool bool_val() const;
334334
const Id& id_val() const;
335335

336+
// TODO(bugs.webrtc.org/15241): remove this definition once downstream
337+
// definitions of StatsReport::Value::id_val() have been deleted.
338+
#ifndef WEBRTC_DEFINES_STATSREPORT_VALUE_ID_VAL
339+
#define WEBRTC_DEFINES_STATSREPORT_VALUE_ID_VAL
340+
#endif // WEBRTC_DEFINES_STATSREPORT_VALUE_ID_VAL
341+
336342
// Returns the string representation of `name`.
337343
const char* display_name() const;
338344

0 commit comments

Comments
 (0)