Bug 1263312 - Have createOffer/Answer resolve with dictionaries. r=drno
☠☠ backed out by a3fe137d4d47 ☠ ☠
authorJan-Ivar Bruaroey <jib@mozilla.com>
Wed, 09 Nov 2016 10:32:11 -0500
changeset 372778 6b71306765d27a1b4f6117cde9723da6284654b2
parent 372777 33449a5d167632fb2eb731f81bcc8ac9305b33e4
child 372779 1814c92e203b853b7cf113711066b22b5ae30a3d
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno
bugs1263312
milestone53.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 1263312 - Have createOffer/Answer resolve with dictionaries. r=drno MozReview-Commit-ID: Flhl2KoqQcX
dom/media/PeerConnection.js
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -725,18 +725,17 @@ RTCPeerConnection.prototype = {
       return this._chain(() => {
         let p = Promise.all([this.getPermission(), this._certificateReady])
           .then(() => new this._win.Promise((resolve, reject) => {
             this._onCreateOfferSuccess = resolve;
             this._onCreateOfferFailure = reject;
             this._impl.createOffer(options);
           }));
         p = this._addIdentityAssertion(p, origin);
-        return p.then(
-          sdp => new this._win.RTCSessionDescription({ type: "offer", sdp: sdp }));
+        return p.then(sdp => Cu.cloneInto({ type: "offer", sdp: sdp }, this._win));
       });
     });
   },
 
   createAnswer: function(optionsOrOnSuccess, onError) {
     // This entry-point handles both new and legacy call sig. Decipher which one
     let onSuccess, options;
     if (typeof optionsOrOnSuccess == "function") {
@@ -760,19 +759,17 @@ RTCPeerConnection.prototype = {
               throw new this._win.DOMException("No outstanding offer",
                                                "InvalidStateError");
             }
             this._onCreateAnswerSuccess = resolve;
             this._onCreateAnswerFailure = reject;
             this._impl.createAnswer();
           }));
         p = this._addIdentityAssertion(p, origin);
-        return p.then(sdp => {
-          return new this._win.RTCSessionDescription({ type: "answer", sdp: sdp });
-        });
+        return p.then(sdp => Cu.cloneInto({ type: "answer", sdp: sdp }, this._win));
       });
     });
   },
 
   getPermission: function() {
     if (this._havePermission) {
       return this._havePermission;
     }
@@ -1124,28 +1121,26 @@ RTCPeerConnection.prototype = {
 
   get localDescription() {
     this._checkClosed();
     let sdp = this._impl.localDescription;
     if (sdp.length == 0) {
       return null;
     }
 
-    return new this._win.RTCSessionDescription({ type: this._localType,
-                                                    sdp: sdp });
+    return new this._win.RTCSessionDescription({ type: this._localType, sdp });
   },
 
   get remoteDescription() {
     this._checkClosed();
     let sdp = this._impl.remoteDescription;
     if (sdp.length == 0) {
       return null;
     }
-    return new this._win.RTCSessionDescription({ type: this._remoteType,
-                                                    sdp: sdp });
+    return new this._win.RTCSessionDescription({ type: this._remoteType, sdp });
   },
 
   get peerIdentity() { return this._peerIdentity; },
   get idpLoginUrl() { return this._localIdp.idpLoginUrl; },
   get id() { return this._impl.id; },
   set id(s) { this._impl.id = s; },
   get iceGatheringState()  { return this._iceGatheringState; },
   get iceConnectionState() { return this._iceConnectionState; },