Bug 934035 - Make PeerConnectionObserver's constructor not take an object argument. r=jib
authorAndrew McCreight <amccreight@mozilla.com>
Fri, 01 Nov 2013 17:49:48 -0700
changeset 153789 1413b0652528c6b767a6d1af38da353b010e44cd
parent 153788 2f9458266db79b0884c88f72b399f0973db18dca
child 153790 0478ca4542504f5f6903a94cf5a0447bde1b0726
push id35890
push useramccreight@mozilla.com
push dateWed, 06 Nov 2013 15:41:00 +0000
treeherdermozilla-inbound@0478ca454250 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs934035
milestone28.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 934035 - Make PeerConnectionObserver's constructor not take an object argument. r=jib
dom/media/PeerConnection.js
dom/webidl/PeerConnectionObserver.webidl
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -254,17 +254,19 @@ RTCPeerConnection.prototype = {
     this.makeGetterSetterEH("onsignalingstatechange");
     this.makeGetterSetterEH("onremovestream");
     this.makeGetterSetterEH("ondatachannel");
     this.makeGetterSetterEH("onconnection");
     this.makeGetterSetterEH("onclosedconnection");
     this.makeGetterSetterEH("oniceconnectionstatechange");
 
     this._pc = new this._win.PeerConnectionImpl();
-    this._observer = new this._win.PeerConnectionObserver(this);
+
+    this.__DOM_IMPL__._innerObject = this;
+    this._observer = new this._win.PeerConnectionObserver(this.__DOM_IMPL__);
     this._winID = this._win.QueryInterface(Ci.nsIInterfaceRequestor)
                            .getInterface(Ci.nsIDOMWindowUtils).currentInnerWindowID;
 
     // Add a reference to the PeerConnection to global list (before init).
     _globalPCList.addPC(this);
 
     this._queueOrRun({
       func: this._initialize,
@@ -840,17 +842,17 @@ PeerConnectionObserver.prototype = {
   classDescription: "PeerConnectionObserver",
   classID: PC_OBS_CID,
   contractID: PC_OBS_CONTRACT,
   QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports,
                                          Ci.nsIDOMGlobalPropertyInitializer]),
   init: function(win) { this._win = win; },
 
   __init: function(dompc) {
-    this._dompc = dompc;
+    this._dompc = dompc._innerObject;
   },
 
   dispatchEvent: function(event) {
     this._dompc.dispatchEvent(event);
   },
 
   callCB: function(callback, arg) {
     if (callback) {
--- a/dom/webidl/PeerConnectionObserver.webidl
+++ b/dom/webidl/PeerConnectionObserver.webidl
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 interface nsISupports;
 
 [ChromeOnly,
  JSImplementation="@mozilla.org/dom/peerconnectionobserver;1",
- Constructor (object domPC)]
+ Constructor (mozRTCPeerConnection domPC)]
 interface PeerConnectionObserver
 {
   /* JSEP callbacks */
   void onCreateOfferSuccess(DOMString offer);
   void onCreateOfferError(unsigned long name, DOMString message);
   void onCreateAnswerSuccess(DOMString answer);
   void onCreateAnswerError(unsigned long name, DOMString message);
   void onSetLocalDescriptionSuccess();