summaryrefslogtreecommitdiff
path: root/dom/media/PeerConnection.js
diff options
context:
space:
mode:
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() {