With this CL, the only usage of RTCStatsMember within WebRTC is the
actual type alias declaration. It's not referenced anywhere anymore.
This allows us to deleting the type alias, but let's do that in a
standalone CL in case it gets reverted.
Bug: webrtc:15164
Change-Id: I766d07abb62b5ddd524859b8ed749394fc439e52
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335621
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41612}
This is a reland of commit 79ac694d9b
Original change's description:
> [Stats] Make RTCStatsMember<T> a type alias for absl::optional<T>.
>
> The moment we've all been waiting for.
>
> Step 1: Add type alias (this CL).
> Step 2: Migrate all uses of RTCStatsMember<T> to absl::optional<T>.
> Step 3: Delete type alias.
>
> Bug: webrtc:15164
> Change-Id: I00a7202c0b684fb2c57fcad4f501bccc167f1fa3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334680
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@google.com>
> Cr-Commit-Position: refs/heads/main@{#41593}
# Only unrelated bot failures
NOTRY=True
Bug: webrtc:15164
Change-Id: I0f1991409326679a260cb24907808eaa28385350
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335960
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/main@{#41603}
This reverts commit 79ac694d9b.
Reason for revert: Breaks downstream (found another use of
ValueOrDefault instead of value_or)...
Original change's description:
> [Stats] Make RTCStatsMember<T> a type alias for absl::optional<T>.
>
> The moment we've all been waiting for.
>
> Step 1: Add type alias (this CL).
> Step 2: Migrate all uses of RTCStatsMember<T> to absl::optional<T>.
> Step 3: Delete type alias.
>
> Bug: webrtc:15164
> Change-Id: I00a7202c0b684fb2c57fcad4f501bccc167f1fa3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334680
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@google.com>
> Cr-Commit-Position: refs/heads/main@{#41593}
Bug: webrtc:15164
Change-Id: Ice3f44057b82a7ba9be000d9a0b714152fd07d2f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335701
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Reviewed-by: Christoffer Dewerin <jansson@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41595}
The moment we've all been waiting for.
Step 1: Add type alias (this CL).
Step 2: Migrate all uses of RTCStatsMember<T> to absl::optional<T>.
Step 3: Delete type alias.
Bug: webrtc:15164
Change-Id: I00a7202c0b684fb2c57fcad4f501bccc167f1fa3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334680
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/main@{#41593}
This is a reland of commit 54be7084e0
Previously reverted due to an importer issue (b/320646178) and later a
dependency on RTCStatsMember<T>::ValueToString().
In this reland, we add Attribute::ToString() but we don't delete the
RTCStatsMember<T> stringifier methods, allowing downstream to migrate
before they are deleted.
Original change's description:
> [Stats] Attribute::ToString(), to replace member ValueToString/ToJson.
>
> Delete RTCStatsMember<T>::ValueToString() and ValueToJson() in favor of
> Attribute::ToString().
>
> The difference between "ToString" and "ToJson" is that the "ToJson"
> version converts 64-bit integers and doubles to floating points with no
> more than ~15 digits of precision as to not exceed JSON's precision
> limitations. So only in edge cases of really large numbers or numbers
> with a silly number of digits will the two methods produce different
> results. Also JSON puts '\"' around map key names, e.g. "{\"foo\":123}"
> as opposed to "{foo:123}".
>
> Going forward we see no reason to maintain two different string
> converted paths that are this similar, so we only implement one
> Attribute::ToString() method which does what "ToJson" did.
>
> In the next CL we can delete RTCStatsMember<T>.
>
> Bug: webrtc:15164
> Change-Id: Iaa8cf3bf14b40dc44664f75989832469603131c5
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334640
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@google.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41544}
Bug: webrtc:15164
Change-Id: I281ccf5b23d8f194b5ce00186a32846c757b46fc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334860
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41575}
Same method, different name. Unblocks replacing RTCStatsMember<T> with
absl::optional<T>.
Bug: webrtc:15164
Change-Id: I251dd44d3b0f9576b3b68915fe0406d1b3381e5c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334641
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41573}
This reverts commit 55cdc29b9d.
Reason for revert: Breaks downstream project.
Original change's description:
> Reland "[Stats] Attribute::ToString(), to replace member ValueToString/ToJson."
>
> This is a reland of commit 54be7084e0
>
> Original change's description:
> > [Stats] Attribute::ToString(), to replace member ValueToString/ToJson.
> >
> > Delete RTCStatsMember<T>::ValueToString() and ValueToJson() in favor of
> > Attribute::ToString().
> >
> > The difference between "ToString" and "ToJson" is that the "ToJson"
> > version converts 64-bit integers and doubles to floating points with no
> > more than ~15 digits of precision as to not exceed JSON's precision
> > limitations. So only in edge cases of really large numbers or numbers
> > with a silly number of digits will the two methods produce different
> > results. Also JSON puts '\"' around map key names, e.g. "{\"foo\":123}"
> > as opposed to "{foo:123}".
> >
> > Going forward we see no reason to maintain two different string
> > converted paths that are this similar, so we only implement one
> > Attribute::ToString() method which does what "ToJson" did.
> >
> > In the next CL we can delete RTCStatsMember<T>.
> >
> > Bug: webrtc:15164
> > Change-Id: Iaa8cf3bf14b40dc44664f75989832469603131c5
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334640
> > Commit-Queue: Henrik Boström <hbos@webrtc.org>
> > Reviewed-by: Evan Shrubsole <eshr@google.com>
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#41544}
>
> Bug: webrtc:15164
> Change-Id: If34509ebf3d7c0291442ae11596e7c2d3978fb64
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335240
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41566}
Bug: webrtc:15164
Change-Id: I5819811237a6dbd85a8c738ca0180039fc705909
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335280
Reviewed-by: Christoffer Dewerin <jansson@google.com>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41567}
This is a reland of commit 54be7084e0
Original change's description:
> [Stats] Attribute::ToString(), to replace member ValueToString/ToJson.
>
> Delete RTCStatsMember<T>::ValueToString() and ValueToJson() in favor of
> Attribute::ToString().
>
> The difference between "ToString" and "ToJson" is that the "ToJson"
> version converts 64-bit integers and doubles to floating points with no
> more than ~15 digits of precision as to not exceed JSON's precision
> limitations. So only in edge cases of really large numbers or numbers
> with a silly number of digits will the two methods produce different
> results. Also JSON puts '\"' around map key names, e.g. "{\"foo\":123}"
> as opposed to "{foo:123}".
>
> Going forward we see no reason to maintain two different string
> converted paths that are this similar, so we only implement one
> Attribute::ToString() method which does what "ToJson" did.
>
> In the next CL we can delete RTCStatsMember<T>.
>
> Bug: webrtc:15164
> Change-Id: Iaa8cf3bf14b40dc44664f75989832469603131c5
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334640
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@google.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41544}
Bug: webrtc:15164
Change-Id: If34509ebf3d7c0291442ae11596e7c2d3978fb64
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335240
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41566}
This is a reland of commit 84c48ae751
Original change's description:
> [Stats] Move metric names to Attribute, constructed via AttributeInit.
>
> As of this CL, Attribute no longer implements RTCStatsMemberInterface
> and a member no longer owns knowing its own name. The attribute knows
> the name because we pass it down at construction time.
>
> To achieve this, the WEBRTC_RTCSTATS_IMPL() macro is updated to take
> AttributeInits instead of raw member pointers, i.e. (name, ptr) pairs.
>
> By constructing RTCStatsMember<T> without a name parameter, it does the
> same thing as the absl::optional<T> constructor. So RTCStatsMember<T>'s
> days are numbered!
>
> Bug: webrtc:15164
> Change-Id: I560c0134bae1c2d7218426a1576425ecc1b677a7
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334203
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@google.com>
> Cr-Commit-Position: refs/heads/main@{#41540}
Bug: webrtc:15164
Change-Id: I28f3d588004ff185e5820347ad9513f2f7a6cc66
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335020
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41556}
This reverts commit 84c48ae751.
Reason for revert: Breaks downstream project
Original change's description:
> [Stats] Move metric names to Attribute, constructed via AttributeInit.
>
> As of this CL, Attribute no longer implements RTCStatsMemberInterface
> and a member no longer owns knowing its own name. The attribute knows
> the name because we pass it down at construction time.
>
> To achieve this, the WEBRTC_RTCSTATS_IMPL() macro is updated to take
> AttributeInits instead of raw member pointers, i.e. (name, ptr) pairs.
>
> By constructing RTCStatsMember<T> without a name parameter, it does the
> same thing as the absl::optional<T> constructor. So RTCStatsMember<T>'s
> days are numbered!
>
> Bug: webrtc:15164
> Change-Id: I560c0134bae1c2d7218426a1576425ecc1b677a7
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334203
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@google.com>
> Cr-Commit-Position: refs/heads/main@{#41540}
Bug: webrtc:15164
Change-Id: I9f416838153b26d4560ae98c37fb18a803d0295d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334901
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41550}
This reverts commit 54be7084e0.
Reason for revert: Breaks downstream project.
Original change's description:
> [Stats] Attribute::ToString(), to replace member ValueToString/ToJson.
>
> Delete RTCStatsMember<T>::ValueToString() and ValueToJson() in favor of
> Attribute::ToString().
>
> The difference between "ToString" and "ToJson" is that the "ToJson"
> version converts 64-bit integers and doubles to floating points with no
> more than ~15 digits of precision as to not exceed JSON's precision
> limitations. So only in edge cases of really large numbers or numbers
> with a silly number of digits will the two methods produce different
> results. Also JSON puts '\"' around map key names, e.g. "{\"foo\":123}"
> as opposed to "{foo:123}".
>
> Going forward we see no reason to maintain two different string
> converted paths that are this similar, so we only implement one
> Attribute::ToString() method which does what "ToJson" did.
>
> In the next CL we can delete RTCStatsMember<T>.
>
> Bug: webrtc:15164
> Change-Id: Iaa8cf3bf14b40dc44664f75989832469603131c5
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334640
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@google.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41544}
Bug: webrtc:15164
Change-Id: I187d7dff6f330a4a440279e6c32d88eb6ddefac8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334820
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41546}
Delete RTCStatsMember<T>::ValueToString() and ValueToJson() in favor of
Attribute::ToString().
The difference between "ToString" and "ToJson" is that the "ToJson"
version converts 64-bit integers and doubles to floating points with no
more than ~15 digits of precision as to not exceed JSON's precision
limitations. So only in edge cases of really large numbers or numbers
with a silly number of digits will the two methods produce different
results. Also JSON puts '\"' around map key names, e.g. "{\"foo\":123}"
as opposed to "{foo:123}".
Going forward we see no reason to maintain two different string
converted paths that are this similar, so we only implement one
Attribute::ToString() method which does what "ToJson" did.
In the next CL we can delete RTCStatsMember<T>.
Bug: webrtc:15164
Change-Id: Iaa8cf3bf14b40dc44664f75989832469603131c5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334640
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41544}
As of this CL, Attribute no longer implements RTCStatsMemberInterface
and a member no longer owns knowing its own name. The attribute knows
the name because we pass it down at construction time.
To achieve this, the WEBRTC_RTCSTATS_IMPL() macro is updated to take
AttributeInits instead of raw member pointers, i.e. (name, ptr) pairs.
By constructing RTCStatsMember<T> without a name parameter, it does the
same thing as the absl::optional<T> constructor. So RTCStatsMember<T>'s
days are numbered!
Bug: webrtc:15164
Change-Id: I560c0134bae1c2d7218426a1576425ecc1b677a7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334203
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/main@{#41540}
One in series of CLs to migrate from Members() to Attributes() to
unblock code deletion.
Adds and makes use of has_value(), holds_alternative<T>() and get<T>()
convenience methods.
Bug: webrtc:15164
Change-Id: I2ae9869a5d1de3f3875c70494c9781d69da7f936
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334160
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/main@{#41510}
Whether a metric is to be exposed to JavaScript or not is a blink
implementation detail that the WebRTC repository does not need to be
concerned with.
This CL removes unused code and paves the way for the possibility of
making the one and only RTCStatsMember class be absl::optional<>-based
in the future.
Bug: webrtc:15162
Change-Id: I578715f48b8fcc3534b72b4c700fd6567f8d553e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304722
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40139}
NonStandardGroupId is no longer wired up to Chrome, but if we did want
to only expose certain metrics if a field trial was enabled then the
right place to do that would be in blink, where WebIDL lives.
This was only used prior to the WebRtcStatsReportIdl launch and
experiments haven't been active in several years so its dead code.
Blocked on:
- https://chromium-review.googlesource.com/c/chromium/src/+/4514754
Bug: webrtc:15162
Change-Id: Ia41a4d21d7e5f029ddb121183fbd69ae7f98fac4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304720
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40132}
making it clear what unit is being used.
BUG=webrtc:13756
Change-Id: I6354d35a8e02bb93a905ccf32cb0b294b4813e41
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/289460
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39008}
Recent WebRTC stats spec changes have added restrictions on what stats
are available to JavaScript. This is done to reduce that fingerprinting
surface of WebRTC getStats. For example, stats exposing hardware
capabilities have requirements that must be met by the browser. See [1]
for more details.
This CL adds the types and the enumerations. Stats with these
restrictions should not be added until Chromium has implemented
filtering based on the stat type.
[1] https://w3c.github.io/webrtc-stats/#limiting-exposure-of-hardware-capabilities
Bug: webrtc:14546
Change-Id: I6dae5d4921c7a2bc828a4fc8f7d68e0c59f3be82
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279043
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38381}