mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-23 00:47:31 +09:00
Issue #2332 - Hyphenate rtc stats type as per spec
Backport of https://bugzilla.mozilla.org/show_bug.cgi?id=1322503
This commit is contained in:
parent
4edd2f91b4
commit
9f63203a43
7 changed files with 57 additions and 42 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue