summaryrefslogtreecommitdiff
path: root/dom/media/PeerConnection.js
diff options
context:
space:
mode:
authorBasilisk-Dev <basiliskdev@protonmail.com>2023-10-18 16:30:27 -0400
committerBasilisk-Dev <basiliskdev@protonmail.com>2023-10-18 16:30:27 -0400
commit5b5672fd5601074dbd06fc077b57879f534b82b6 (patch)
tree81eac0c2148f5cf401ee470f3d3f954164c82b15 /dom/media/PeerConnection.js
parent087febcc4b017a0af4ec82b1283341c8d979a17e (diff)
downloaduxp-5b5672fd5601074dbd06fc077b57879f534b82b6.tar.gz
Issue #2332 - Hyphenate rtc stats type as per spec
Backport of https://bugzilla.mozilla.org/show_bug.cgi?id=1322503
Diffstat (limited to 'dom/media/PeerConnection.js')
-rw-r--r--dom/media/PeerConnection.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js
index e4612f8316..784ba822b3 100644
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -308,13 +308,20 @@ RTCStatsReport.prototype = {
// Since maplike is recent, we still also make the stats available as legacy
// enumerable read-only properties directly on our content-facing object.
// Must be called after our webidl sandwich is made.
+ _specToLegacyFieldMapping: {
+ 'inbound-rtp' : 'inboundrtp',
+ 'outbound-rtp':'outboundrtp',
+ 'candidate-pair':'candidatepair',
+ 'local-candidate':'localcandidate',
+ 'remote-candidate':'remotecandidate'
+ },
makeStatsPublic: function(warnNullable) {
let legacyProps = {};
for (let key in this._report) {
+ this.setInternal(key, Cu.cloneInto(this._report[key], this._win));
let value = Cu.cloneInto(this._report[key], this._win);
- this.setInternal(key, value);
-
+ value.type = this._specToLegacyFieldMapping[value.type] || value.type;
legacyProps[key] = {
enumerable: true, configurable: false,
get: Cu.exportFunction(function() {