mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-23 23:57:31 +09:00
No Issue - Remove deprecation errors for obsolete RTCOfferOptions
Backport of https://bugzilla.mozilla.org/show_bug.cgi?id=1197021
This commit is contained in:
parent
f21cc50c03
commit
6fdb3ac961
2 changed files with 0 additions and 54 deletions
|
|
@ -702,49 +702,6 @@ RTCPeerConnection.prototype = {
|
||||||
options = optionsOrOnSuccess;
|
options = optionsOrOnSuccess;
|
||||||
}
|
}
|
||||||
return this._legacyCatchAndCloseGuard(onSuccess, onError, () => {
|
return this._legacyCatchAndCloseGuard(onSuccess, onError, () => {
|
||||||
// TODO: Remove error on constraint-like RTCOptions next cycle (1197021).
|
|
||||||
// Note that webidl bindings make o.mandatory implicit but not o.optional.
|
|
||||||
function convertLegacyOptions(o) {
|
|
||||||
// Detect (mandatory OR optional) AND no other top-level members.
|
|
||||||
let lcy = ((o.mandatory && Object.keys(o.mandatory).length) || o.optional) &&
|
|
||||||
Object.keys(o).length == (o.mandatory? 1 : 0) + (o.optional? 1 : 0);
|
|
||||||
if (!lcy) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
let old = o.mandatory || {};
|
|
||||||
if (o.mandatory) {
|
|
||||||
delete o.mandatory;
|
|
||||||
}
|
|
||||||
if (o.optional) {
|
|
||||||
o.optional.forEach(one => {
|
|
||||||
// The old spec had optional as an array of objects w/1 attribute each.
|
|
||||||
// Assumes our JS-webidl bindings only populate passed-in properties.
|
|
||||||
let key = Object.keys(one)[0];
|
|
||||||
if (key && old[key] === undefined) {
|
|
||||||
old[key] = one[key];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
delete o.optional;
|
|
||||||
}
|
|
||||||
o.offerToReceiveAudio = old.OfferToReceiveAudio;
|
|
||||||
o.offerToReceiveVideo = old.OfferToReceiveVideo;
|
|
||||||
o.mozDontOfferDataChannel = old.MozDontOfferDataChannel;
|
|
||||||
o.mozBundleOnly = old.MozBundleOnly;
|
|
||||||
Object.keys(o).forEach(k => {
|
|
||||||
if (o[k] === undefined) {
|
|
||||||
delete o[k];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options && convertLegacyOptions(options)) {
|
|
||||||
this.logError(
|
|
||||||
"Mandatory/optional in createOffer options no longer works! Use " +
|
|
||||||
JSON.stringify(options) + " instead (note the case difference)!");
|
|
||||||
options = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
let origin = Cu.getWebIDLCallerPrincipal().origin;
|
let origin = Cu.getWebIDLCallerPrincipal().origin;
|
||||||
return this._chain(() => {
|
return this._chain(() => {
|
||||||
let p = Promise.all([this.getPermission(), this._certificateReady])
|
let p = Promise.all([this.getPermission(), this._certificateReady])
|
||||||
|
|
|
||||||
|
|
@ -66,17 +66,6 @@ dictionary RTCOfferOptions : RTCOfferAnswerOptions {
|
||||||
// Mozilla proprietary options (at risk: Bug 1196974)
|
// Mozilla proprietary options (at risk: Bug 1196974)
|
||||||
boolean mozDontOfferDataChannel;
|
boolean mozDontOfferDataChannel;
|
||||||
boolean mozBundleOnly;
|
boolean mozBundleOnly;
|
||||||
|
|
||||||
// TODO: Remove old constraint-like RTCOptions support soon (Bug 1064223).
|
|
||||||
DeprecatedRTCOfferOptionsSet mandatory;
|
|
||||||
sequence<DeprecatedRTCOfferOptionsSet> _optional;
|
|
||||||
};
|
|
||||||
|
|
||||||
dictionary DeprecatedRTCOfferOptionsSet {
|
|
||||||
boolean OfferToReceiveAudio; // Note the uppercase 'O'
|
|
||||||
boolean OfferToReceiveVideo; // Note the uppercase 'O'
|
|
||||||
boolean MozDontOfferDataChannel; // Note the uppercase 'M'
|
|
||||||
boolean MozBundleOnly; // Note the uppercase 'M'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface RTCDataChannel;
|
interface RTCDataChannel;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue