mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1187206 - Adding checks for null SDP, r=jib
This commit is contained in:
parent
8390ee2ff1
commit
144c43c724
@ -761,6 +761,13 @@ RTCPeerConnection.prototype = {
|
||||
"Invalid type " + desc.type + " provided to setLocalDescription",
|
||||
"InvalidParameterError");
|
||||
}
|
||||
|
||||
if (desc.type !== "rollback" && !desc.sdp) {
|
||||
throw new this._win.DOMException(
|
||||
"Empty or null SDP provided to setLocalDescription",
|
||||
"InvalidParameterError");
|
||||
}
|
||||
|
||||
return this._chain(() => new this._win.Promise((resolve, reject) => {
|
||||
this._onSetLocalDescriptionSuccess = resolve;
|
||||
this._onSetLocalDescriptionFailure = reject;
|
||||
@ -835,21 +842,34 @@ RTCPeerConnection.prototype = {
|
||||
default:
|
||||
throw new this._win.DOMException(
|
||||
"Invalid type " + desc.type + " provided to setRemoteDescription",
|
||||
"InvalidParameterError");
|
||||
}
|
||||
|
||||
if (!desc.sdp && desc.type !== "rollback") {
|
||||
throw new this._win.DOMException(
|
||||
"Empty or null SDP provided to setRemoteDescription",
|
||||
"InvalidParameterError");
|
||||
}
|
||||
|
||||
// Get caller's origin before hitting the promise chain
|
||||
let origin = Cu.getWebIDLCallerPrincipal().origin;
|
||||
|
||||
// Do setRemoteDescription and identity validation in parallel
|
||||
return this._chain(() => this._win.Promise.all([
|
||||
new this._win.Promise((resolve, reject) => {
|
||||
return this._chain(() => {
|
||||
let setRem = new this._win.Promise((resolve, reject) => {
|
||||
this._onSetRemoteDescriptionSuccess = resolve;
|
||||
this._onSetRemoteDescriptionFailure = reject;
|
||||
this._impl.setRemoteDescription(type, desc.sdp);
|
||||
}),
|
||||
this._validateIdentity(desc.sdp, origin)
|
||||
])).then(() => {}); // must return undefined
|
||||
});
|
||||
|
||||
if (desc.type === "rollback") {
|
||||
return setRem;
|
||||
}
|
||||
|
||||
// Do setRemoteDescription and identity validation in parallel
|
||||
let validId = this._validateIdentity(desc.sdp, origin);
|
||||
return this._win.Promise.all([setRem, validId])
|
||||
.then(() => {}); // must return undefined
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user