Bug 1567951: Add implicit rollback in setRemoteDescription(offer). r=bwc

Differential Revision: https://phabricator.services.mozilla.com/D38889

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jan-Ivar Bruaroey 2019-07-23 18:07:18 +00:00
Родитель e915ec88ec
Коммит 5bce336f55
1 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -1224,8 +1224,18 @@ class RTCPeerConnection {
let origin = Cu.getWebIDLCallerPrincipal().origin;
return this._chain(async () => {
let haveSetRemote = (async () => {
const haveSetRemote = (async () => {
await this._getPermission();
if (type == "offer" && this.signalingState == "have-local-offer") {
await new Promise((resolve, reject) => {
this._onSetLocalDescriptionSuccess = resolve;
this._onSetLocalDescriptionFailure = reject;
this._impl.setLocalDescription(
Ci.IPeerConnection.kActionRollback,
""
);
});
}
await new Promise((resolve, reject) => {
this._onSetRemoteDescriptionSuccess = resolve;
this._onSetRemoteDescriptionFailure = reject;