Bug 1435013: Sync transceivers before creating offers/answers. r=jib
authorByron Campen [:bwc] <docfaraday@gmail.com>
Thu, 01 Feb 2018 12:07:02 -0600
changeset 402805 c20f2aab0fa3b2db00b3e5e40062af850ee12050
parent 402804 e6d5ac399a43921d0b1253f2350c949f46c57a90
child 402806 89ac5a28c228649e436cd8dbcec0d395c231e4e1
push id99659
push useraciure@mozilla.com
push dateWed, 07 Feb 2018 22:33:57 +0000
treeherdermozilla-inbound@5ceb1098fef3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1435013
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1435013: Sync transceivers before creating offers/answers. r=jib MozReview-Commit-ID: EORXVc8Hnky
dom/media/PeerConnection.js
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -842,16 +842,17 @@ class RTCPeerConnection {
         } else if (transceiver.direction == "recvonly") {
           transceiver.setDirectionInternal("inactive");
         }
       });
   }
 
   async _createOffer(options) {
     this._checkClosed();
+    this._syncTransceivers();
     let origin = Cu.getWebIDLCallerPrincipal().origin;
     return this._chain(async () => {
       let haveAssertion;
       if (this._localIdp.enabled) {
         haveAssertion = this._getIdentityAssertion(origin);
       }
       await this._getPermission();
       await this._certificateReady;
@@ -873,16 +874,17 @@ class RTCPeerConnection {
     if (typeof optionsOrOnSucc == "function") {
       return this._legacy(optionsOrOnSucc, onErr, () => this._createAnswer({}));
     }
     return this._async(() => this._createAnswer(optionsOrOnSucc));
   }
 
   async _createAnswer(options) {
     this._checkClosed();
+    this._syncTransceivers();
     let origin = Cu.getWebIDLCallerPrincipal().origin;
     return this._chain(async () => {
       // We give up line-numbers in errors by doing this here, but do all
       // state-checks inside the chain, to support the legacy feature that
       // callers don't have to wait for setRemoteDescription to finish.
       if (!this.remoteDescription) {
         throw new this._win.DOMException("setRemoteDescription not called",
                                          "InvalidStateError");