diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js index ec308f01e49..0f712980bc5 100644 --- a/dom/media/PeerConnection.js +++ b/dom/media/PeerConnection.js @@ -13,17 +13,11 @@ const PC_CONTRACT = "@mozilla.org/dom/peerconnection;1"; const PC_ICE_CONTRACT = "@mozilla.org/dom/rtcicecandidate;1"; const PC_SESSION_CONTRACT = "@mozilla.org/dom/rtcsessiondescription;1"; const PC_MANAGER_CONTRACT = "@mozilla.org/dom/peerconnectionmanager;1"; -const PC_ICEEVENT_CONTRACT = "@mozilla.org/dom/rtcpeerconnectioniceevent;1"; -const MSEVENT_CONTRACT = "@mozilla.org/dom/mediastreamevent;1"; -const DCEVENT_CONTRACT = "@mozilla.org/dom/datachannelevent;1"; const PC_CID = Components.ID("{9878b414-afaa-4176-a887-1e02b3b047c2}"); const PC_ICE_CID = Components.ID("{02b9970c-433d-4cc2-923d-f7028ac66073}"); const PC_SESSION_CID = Components.ID("{1775081b-b62d-4954-8ffe-a067bbf508a7}"); const PC_MANAGER_CID = Components.ID("{7293e901-2be3-4c02-b4bd-cbef6fc24f78}"); -const PC_ICEEVENT_CID = Components.ID("{b9cd25a7-9859-4f9e-8f84-ef5181ff36c0}"); -const MSEVENT_CID = Components.ID("{a722a8a9-2290-4e99-a5ed-07b504292d08}"); -const DCEVENT_CID = Components.ID("{d5ed7fbf-01a8-4b18-af6c-861cf2aac920}"); // Global list of PeerConnection objects, so they can be cleaned up when // a page is torn down. (Maps inner window ID to an array of PC objects). @@ -156,72 +150,6 @@ RTCSessionDescription.prototype = { } }; -function MediaStreamEvent() { - this.type = this._stream = null; -} -MediaStreamEvent.prototype = { - classDescription: "MediaStreamEvent", - classID: MSEVENT_CID, - contractID: MSEVENT_CONTRACT, - QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, - Ci.nsIDOMGlobalPropertyInitializer]), - - init: function(win) { this._win = win; }, - - __init: function(type, dict) { - this.type = type; - this.__DOM_IMPL__.initEvent(type, dict.bubbles || false, - dict.cancelable || false); - this._stream = dict.stream; - }, - - get stream() { return this._stream; } -}; - -function RTCDataChannelEvent() { - this.type = this._channel = null; -} -RTCDataChannelEvent.prototype = { - classDescription: "RTCDataChannelEvent", - classID: DCEVENT_CID, - contractID: DCEVENT_CONTRACT, - QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, - Ci.nsIDOMGlobalPropertyInitializer]), - - init: function(win) { this._win = win; }, - - __init: function(type, dict) { - this.type = type; - this.__DOM_IMPL__.initEvent(type, dict.bubbles || false, - dict.cancelable || false); - this._channel = dict.channel; - }, - - get channel() { return this._channel; } -}; - -function RTCPeerConnectionIceEvent() { - this.type = this._candidate = null; -} -RTCPeerConnectionIceEvent.prototype = { - classDescription: "RTCPeerConnectionIceEvent", - classID: PC_ICEEVENT_CID, - contractID: PC_ICEEVENT_CONTRACT, - QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, - Ci.nsIDOMGlobalPropertyInitializer]), - - init: function(win) { this._win = win; }, - - __init: function(type, dict) { - this.type = type; - this.__DOM_IMPL__.initEvent(type, dict.bubbles || false, - dict.cancelable || false); - this._candidate = dict.candidate; - }, - - get candidate() { return this._candidate; } -}; - function RTCPeerConnection() { this._queue = []; @@ -1101,6 +1029,5 @@ PeerConnectionObserver.prototype = { }; this.NSGetFactory = XPCOMUtils.generateNSGetFactory( - [GlobalPCList, RTCIceCandidate, RTCSessionDescription, RTCPeerConnection, - RTCPeerConnectionIceEvent, MediaStreamEvent, RTCDataChannelEvent] + [GlobalPCList, RTCIceCandidate, RTCSessionDescription, RTCPeerConnection] ); diff --git a/dom/media/PeerConnection.manifest b/dom/media/PeerConnection.manifest index e93bc7572b4..d0aff042499 100644 --- a/dom/media/PeerConnection.manifest +++ b/dom/media/PeerConnection.manifest @@ -2,14 +2,8 @@ component {9878b414-afaa-4176-a887-1e02b3b047c2} PeerConnection.js component {02b9970c-433d-4cc2-923d-f7028ac66073} PeerConnection.js component {1775081b-b62d-4954-8ffe-a067bbf508a7} PeerConnection.js component {7293e901-2be3-4c02-b4bd-cbef6fc24f78} PeerConnection.js -component {b9cd25a7-9859-4f9e-8f84-ef5181ff36c0} PeerConnection.js -component {a722a8a9-2290-4e99-a5ed-07b504292d08} PeerConnection.js -component {d5ed7fbf-01a8-4b18-af6c-861cf2aac920} PeerConnection.js contract @mozilla.org/dom/peerconnection;1 {9878b414-afaa-4176-a887-1e02b3b047c2} contract @mozilla.org/dom/rtcicecandidate;1 {02b9970c-433d-4cc2-923d-f7028ac66073} contract @mozilla.org/dom/rtcsessiondescription;1 {1775081b-b62d-4954-8ffe-a067bbf508a7} contract @mozilla.org/dom/peerconnectionmanager;1 {7293e901-2be3-4c02-b4bd-cbef6fc24f78} -contract @mozilla.org/dom/rtcpeerconnectioniceevent;1 {b9cd25a7-9859-4f9e-8f84-ef5181ff36c0} -contract @mozilla.org/dom/mediastreamevent;1 {a722a8a9-2290-4e99-a5ed-07b504292d08} -contract @mozilla.org/dom/datachannelevent;1 {d5ed7fbf-01a8-4b18-af6c-861cf2aac920} diff --git a/dom/webidl/MediaStreamEvent.webidl b/dom/webidl/MediaStreamEvent.webidl index b2800e3de02..56bac3a866d 100644 --- a/dom/webidl/MediaStreamEvent.webidl +++ b/dom/webidl/MediaStreamEvent.webidl @@ -12,7 +12,6 @@ dictionary MediaStreamEventInit : EventInit { }; [Pref="media.peerconnection.enabled", - JSImplementation="@mozilla.org/dom/mediastreamevent;1", Constructor(DOMString type, optional MediaStreamEventInit eventInitDict)] interface MediaStreamEvent : Event { readonly attribute MediaStream? stream; diff --git a/dom/webidl/RTCDataChannelEvent.webidl b/dom/webidl/RTCDataChannelEvent.webidl index c77e2c4b465..4c74bddb0ef 100644 --- a/dom/webidl/RTCDataChannelEvent.webidl +++ b/dom/webidl/RTCDataChannelEvent.webidl @@ -14,7 +14,6 @@ dictionary RTCDataChannelEventInit : EventInit { }; [Pref="media.peerconnection.enabled", - JSImplementation="@mozilla.org/dom/datachannelevent;1", Constructor(DOMString type, optional RTCDataChannelEventInit eventInitDict)] interface RTCDataChannelEvent : Event { readonly attribute RTCDataChannel? channel; diff --git a/dom/webidl/RTCPeerConnectionIceEvent.webidl b/dom/webidl/RTCPeerConnectionIceEvent.webidl index 7eefe607d05..a200946fc5d 100644 --- a/dom/webidl/RTCPeerConnectionIceEvent.webidl +++ b/dom/webidl/RTCPeerConnectionIceEvent.webidl @@ -12,7 +12,6 @@ dictionary RTCPeerConnectionIceEventInit : EventInit { }; [Pref="media.peerconnection.enabled", - JSImplementation="@mozilla.org/dom/rtcpeerconnectioniceevent;1", Constructor(DOMString type, optional RTCPeerConnectionIceEventInit eventInitDict)] interface RTCPeerConnectionIceEvent : Event { diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index 81d95ad5ff6..9202ae1f8f1 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -203,7 +203,6 @@ WEBIDL_FILES = [ 'MediaStream.webidl', 'MediaStreamAudioDestinationNode.webidl', 'MediaStreamAudioSourceNode.webidl', - 'MediaStreamEvent.webidl', 'MediaStreamTrack.webidl', 'MessageChannel.webidl', 'MessageEvent.webidl', @@ -253,10 +252,8 @@ WEBIDL_FILES = [ 'Rect.webidl', 'RGBColor.webidl', 'RTCConfiguration.webidl', - 'RTCDataChannelEvent.webidl', 'RTCIceCandidate.webidl', 'RTCPeerConnection.webidl', - 'RTCPeerConnectionIceEvent.webidl', 'RTCSessionDescription.webidl', 'Screen.webidl', 'ScriptProcessorNode.webidl', @@ -541,6 +538,9 @@ GENERATED_EVENTS_WEBIDL_FILES = [ 'BlobEvent.webidl', 'DeviceLightEvent.webidl', 'DeviceProximityEvent.webidl', + 'MediaStreamEvent.webidl', + 'RTCDataChannelEvent.webidl', + 'RTCPeerConnectionIceEvent.webidl', 'UserProximityEvent.webidl', ]