diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index eaa9be9769d1..b2bfab550e5b 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -316,11 +316,6 @@ @RESPATH@/components/ClearDataService.manifest @RESPATH@/components/ClearDataService.js -#ifdef MOZ_WEBRTC -@RESPATH@/components/PeerConnection.js -@RESPATH@/components/PeerConnection.manifest -#endif - ; Remote control protocol #ifdef ENABLE_MARIONETTE @RESPATH@/chrome/marionette@JAREXT@ diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.jsm similarity index 99% rename from dom/media/PeerConnection.js rename to dom/media/PeerConnection.jsm index 01e805c1f184..9087d6e4d66d 100644 --- a/dom/media/PeerConnection.js +++ b/dom/media/PeerConnection.jsm @@ -6,19 +6,15 @@ "use strict"; const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); -const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); ChromeUtils.defineModuleGetter(this, "PeerConnectionIdp", "resource://gre/modules/media/PeerConnectionIdp.jsm"); ChromeUtils.defineModuleGetter(this, "convertToRTCStatsReport", "resource://gre/modules/media/RTCStatsReport.jsm"); -ChromeUtils.defineModuleGetter(this, "AppConstants", - "resource://gre/modules/AppConstants.jsm"); const PC_CONTRACT = "@mozilla.org/dom/peerconnection;1"; const PC_OBS_CONTRACT = "@mozilla.org/dom/peerconnectionobserver;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_STATS_CONTRACT = "@mozilla.org/dom/rtcstatsreport;1"; const PC_STATIC_CONTRACT = "@mozilla.org/dom/peerconnectionstatic;1"; const PC_SENDER_CONTRACT = "@mozilla.org/dom/rtpsender;1"; @@ -2385,17 +2381,16 @@ setupPrototype(CreateOfferRequest, { QueryInterface: ChromeUtils.generateQI([]), }); -this.NSGetFactory = XPCOMUtils.generateNSGetFactory( - [GlobalPCList, - RTCDTMFSender, - RTCIceCandidate, - RTCSessionDescription, - RTCPeerConnection, - RTCPeerConnectionStatic, - RTCRtpReceiver, - RTCRtpSender, - RTCRtpTransceiver, - RTCStatsReport, - PeerConnectionObserver, - CreateOfferRequest] -); +var EXPORTED_SYMBOLS = + ["GlobalPCList", + "RTCDTMFSender", + "RTCIceCandidate", + "RTCSessionDescription", + "RTCPeerConnection", + "RTCPeerConnectionStatic", + "RTCRtpReceiver", + "RTCRtpSender", + "RTCRtpTransceiver", + "RTCStatsReport", + "PeerConnectionObserver", + "CreateOfferRequest"]; diff --git a/dom/media/PeerConnection.manifest b/dom/media/PeerConnection.manifest deleted file mode 100644 index 8edd721acb9b..000000000000 --- a/dom/media/PeerConnection.manifest +++ /dev/null @@ -1,23 +0,0 @@ -component {bdc2e533-b308-4708-ac8e-a8bfade6d851} PeerConnection.js -component {d1748d4c-7f6a-4dc5-add6-d55b7678537e} 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 {7fe6e18b-0da3-4056-bf3b-440ef3809e06} PeerConnection.js -component {0fb47c47-a205-4583-a9fc-cbadf8c95880} PeerConnection.js -component {4fff5d46-d827-4cd4-a970-8fd53977440e} PeerConnection.js -component {d974b814-8fde-411c-8c45-b86791b81030} PeerConnection.js -component {74b2122d-65a8-4824-aa9e-3d664cb75dc2} PeerConnection.js -component {3610C242-654E-11E6-8EC0-6D1BE389A607} PeerConnection.js - -contract @mozilla.org/dom/peerconnection;1 {bdc2e533-b308-4708-ac8e-a8bfade6d851} -contract @mozilla.org/dom/peerconnectionobserver;1 {d1748d4c-7f6a-4dc5-add6-d55b7678537e} -contract @mozilla.org/dom/rtcdtmfsender;1 {3610C242-654E-11E6-8EC0-6D1BE389A607} -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/rtcstatsreport;1 {7fe6e18b-0da3-4056-bf3b-440ef3809e06} -contract @mozilla.org/dom/peerconnectionstatic;1 {0fb47c47-a205-4583-a9fc-cbadf8c95880} -contract @mozilla.org/dom/rtpsender;1 {4fff5d46-d827-4cd4-a970-8fd53977440e} -contract @mozilla.org/dom/rtpreceiver;1 {d974b814-8fde-411c-8c45-b86791b81030} -contract @mozilla.org/dom/createofferrequest;1 {74b2122d-65a8-4824-aa9e-3d664cb75dc2} diff --git a/dom/media/components.conf b/dom/media/components.conf new file mode 100644 index 000000000000..599c6686a177 --- /dev/null +++ b/dom/media/components.conf @@ -0,0 +1,74 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# 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/. + +Classes = [ + { + 'cid': '{bdc2e533-b308-4708-ac8e-a8bfade6d851}', + 'contract_ids': ['@mozilla.org/dom/peerconnection;1'], + 'jsm': 'resource://gre/modules/media/PeerConnection.jsm', + 'constructor': 'RTCPeerConnection', + }, + { + 'cid': '{d1748d4c-7f6a-4dc5-add6-d55b7678537e}', + 'contract_ids': ['@mozilla.org/dom/peerconnectionobserver;1'], + 'jsm': 'resource://gre/modules/media/PeerConnection.jsm', + 'constructor': 'PeerConnectionObserver', + }, + { + 'cid': '{3610C242-654E-11E6-8EC0-6D1BE389A607}', + 'contract_ids': ['@mozilla.org/dom/rtcdtmfsender;1'], + 'jsm': 'resource://gre/modules/media/PeerConnection.jsm', + 'constructor': 'RTCDTMFSender', + }, + { + 'cid': '{02b9970c-433d-4cc2-923d-f7028ac66073}', + 'contract_ids': ['@mozilla.org/dom/rtcicecandidate;1'], + 'jsm': 'resource://gre/modules/media/PeerConnection.jsm', + 'constructor': 'RTCIceCandidate', + }, + { + 'cid': '{1775081b-b62d-4954-8ffe-a067bbf508a7}', + 'contract_ids': ['@mozilla.org/dom/rtcsessiondescription;1'], + 'jsm': 'resource://gre/modules/media/PeerConnection.jsm', + 'constructor': 'RTCSessionDescription', + }, + { + 'cid': '{7293e901-2be3-4c02-b4bd-cbef6fc24f78}', + 'contract_ids': ['@mozilla.org/dom/peerconnectionmanager;1'], + 'jsm': 'resource://gre/modules/media/PeerConnection.jsm', + 'constructor': 'GlobalPCList', + }, + { + 'cid': '{7fe6e18b-0da3-4056-bf3b-440ef3809e06}', + 'contract_ids': ['@mozilla.org/dom/rtcstatsreport;1'], + 'jsm': 'resource://gre/modules/media/PeerConnection.jsm', + 'constructor': 'RTCStatsReport', + }, + { + 'cid': '{0fb47c47-a205-4583-a9fc-cbadf8c95880}', + 'contract_ids': ['@mozilla.org/dom/peerconnectionstatic;1'], + 'jsm': 'resource://gre/modules/media/PeerConnection.jsm', + 'constructor': 'RTCPeerConnectionStatic', + }, + { + 'cid': '{4fff5d46-d827-4cd4-a970-8fd53977440e}', + 'contract_ids': ['@mozilla.org/dom/rtpsender;1'], + 'jsm': 'resource://gre/modules/media/PeerConnection.jsm', + 'constructor': 'RTCRtpSender', + }, + { + 'cid': '{d974b814-8fde-411c-8c45-b86791b81030}', + 'contract_ids': ['@mozilla.org/dom/rtpreceiver;1'], + 'jsm': 'resource://gre/modules/media/PeerConnection.jsm', + 'constructor': 'RTCRtpReceiver', + }, + { + 'cid': '{74b2122d-65a8-4824-aa9e-3d664cb75dc2}', + 'contract_ids': ['@mozilla.org/dom/createofferrequest;1'], + 'jsm': 'resource://gre/modules/media/PeerConnection.jsm', + 'constructor': 'CreateOfferRequest', + }, +] diff --git a/dom/media/moz.build b/dom/media/moz.build index 1cbaa8fbc9f7..7a9877acbccb 100644 --- a/dom/media/moz.build +++ b/dom/media/moz.build @@ -307,10 +307,14 @@ SOURCES += [ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'): SOURCES['DecoderTraits.cpp'].flags += ['-Wno-error=multichar'] -EXTRA_COMPONENTS += [ - 'PeerConnection.js', - 'PeerConnection.manifest', -] +if CONFIG['MOZ_WEBRTC']: + XPCOM_MANIFESTS += [ + 'components.conf', + ] + + EXTRA_JS_MODULES.media += [ + 'PeerConnection.jsm', + ] EXTRA_JS_MODULES.media += [ 'IdpSandbox.jsm', diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in index e98c307faa1e..2c5351b9a5c4 100644 --- a/mobile/android/installer/package-manifest.in +++ b/mobile/android/installer/package-manifest.in @@ -198,11 +198,6 @@ @BINPATH@/components/htmlMenuBuilder.js @BINPATH@/components/htmlMenuBuilder.manifest -#ifdef MOZ_WEBRTC -@BINPATH@/components/PeerConnection.js -@BINPATH@/components/PeerConnection.manifest -#endif - @BINPATH@/components/CaptivePortalDetectComponents.manifest @BINPATH@/components/captivedetect.js