diff --git a/browser/base/content/test/static/browser_all_files_referenced.js b/browser/base/content/test/static/browser_all_files_referenced.js index 33477b260db2..e9d76cfc978d 100644 --- a/browser/base/content/test/static/browser_all_files_referenced.js +++ b/browser/base/content/test/static/browser_all_files_referenced.js @@ -166,8 +166,6 @@ var whitelist = [ {file: "resource://gre/modules/ISO8601DateUtils.jsm"}, // Bug 1337345 {file: "resource://gre/modules/Manifest.jsm"}, - // Bug 1351089 - {file: "resource://gre/modules/PresentationDeviceInfoManager.jsm"}, // Bug 1351097 {file: "resource://gre/modules/accessibility/AccessFu.jsm"}, // Bug 1351637 diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index 0b49a8d3bc58..5628741e7894 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -546,8 +546,6 @@ @RESPATH@/components/nsAsyncShutdown.manifest @RESPATH@/components/nsAsyncShutdown.js -@RESPATH@/components/PresentationDeviceInfoManager.manifest -@RESPATH@/components/PresentationDeviceInfoManager.js @RESPATH@/components/BuiltinProviders.manifest @RESPATH@/components/PresentationControlService.js @RESPATH@/components/PresentationDataChannelSessionTransport.js diff --git a/dom/presentation/PresentationDeviceInfoManager.js b/dom/presentation/PresentationDeviceInfoManager.js deleted file mode 100644 index 29e7d370cec5..000000000000 --- a/dom/presentation/PresentationDeviceInfoManager.js +++ /dev/null @@ -1,119 +0,0 @@ -/* 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/. */ - -"use strict"; - -const {classes: Cc, interfaces: Ci, utils: Cu} = Components; - -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/DOMRequestHelper.jsm"); - -function log(aMsg) { - //dump("-*- PresentationDeviceInfoManager.js : " + aMsg + "\n"); -} - -const PRESENTATIONDEVICEINFOMANAGER_CID = Components.ID("{1bd66bef-f643-4be3-b690-0c656353eafd}"); -const PRESENTATIONDEVICEINFOMANAGER_CONTRACTID = "@mozilla.org/presentation-device/deviceInfo;1"; - -XPCOMUtils.defineLazyServiceGetter(this, "cpmm", - "@mozilla.org/childprocessmessagemanager;1", - "nsIMessageSender"); - -function PresentationDeviceInfoManager() {} - -PresentationDeviceInfoManager.prototype = { - __proto__: DOMRequestIpcHelper.prototype, - - classID: PRESENTATIONDEVICEINFOMANAGER_CID, - contractID: PRESENTATIONDEVICEINFOMANAGER_CONTRACTID, - QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference, - Ci.nsIObserver, - Ci.nsIDOMGlobalPropertyInitializer]), - - receiveMessage: function(aMsg) { - if (!aMsg || !aMsg.data) { - return; - } - - let data = aMsg.data; - - log("receive aMsg: " + aMsg.name); - switch (aMsg.name) { - case "PresentationDeviceInfoManager:OnDeviceChange": { - let detail = { - detail: { - type: data.type, - deviceInfo: data.deviceInfo, - } - }; - let event = new this._window.CustomEvent("devicechange", Cu.cloneInto(detail, this._window)); - this.__DOM_IMPL__.dispatchEvent(event); - break; - } - case "PresentationDeviceInfoManager:GetAll:Result:Ok": { - let resolver = this.takePromiseResolver(data.requestId); - - if (!resolver) { - return; - } - - resolver.resolve(Cu.cloneInto(data.devices, this._window)); - break; - } - case "PresentationDeviceInfoManager:GetAll:Result:Error": { - let resolver = this.takePromiseResolver(data.requestId); - - if (!resolver) { - return; - } - - resolver.reject(data.error); - break; - } - } - }, - - init: function(aWin) { - log("init"); - this.initDOMRequestHelper(aWin, [ - {name: "PresentationDeviceInfoManager:OnDeviceChange", weakRef: true}, - {name: "PresentationDeviceInfoManager:GetAll:Result:Ok", weakRef: true}, - {name: "PresentationDeviceInfoManager:GetAll:Result:Error", weakRef: true}, - ]); - }, - - uninit: function() { - log("uninit"); - let self = this; - - this.forEachPromiseResolver(function(aKey) { - self.takePromiseResolver(aKey).reject("PresentationDeviceInfoManager got destroyed"); - }); - }, - - get ondevicechange() { - return this.__DOM_IMPL__.getEventHandler("ondevicechange"); - }, - - set ondevicechange(aHandler) { - this.__DOM_IMPL__.setEventHandler("ondevicechange", aHandler); - }, - - getAll: function() { - log("getAll"); - let self = this; - return this.createPromiseWithId(function(aResolverId) { - cpmm.sendAsyncMessage("PresentationDeviceInfoManager:GetAll", { - requestId: aResolverId, - }); - }); - }, - - forceDiscovery: function() { - cpmm.sendAsyncMessage("PresentationDeviceInfoManager:ForceDiscovery"); - }, -}; - -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PresentationDeviceInfoManager]); diff --git a/dom/presentation/PresentationDeviceInfoManager.jsm b/dom/presentation/PresentationDeviceInfoManager.jsm deleted file mode 100644 index df5cbb07f81d..000000000000 --- a/dom/presentation/PresentationDeviceInfoManager.jsm +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- / -/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ -/* 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/. */ - -"use strict"; - -const {classes: Cc, interfaces: Ci, utils: Cu} = Components; - -this.EXPORTED_SYMBOLS = ["PresentationDeviceInfoService"]; - -function log(aMsg) { - //dump("PresentationDeviceInfoManager.jsm: " + aMsg + "\n"); -} - -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); - -XPCOMUtils.defineLazyServiceGetter(this, "presentationDeviceManager", - "@mozilla.org/presentation-device/manager;1", - "nsIPresentationDeviceManager"); - -XPCOMUtils.defineLazyServiceGetter(this, "ppmm", - "@mozilla.org/parentprocessmessagemanager;1", - "nsIMessageBroadcaster"); - -this.PresentationDeviceInfoService = { - QueryInterface: XPCOMUtils.generateQI([Ci.nsIMessageListener, - Ci.nsIObserver]), - - init: function() { - log("init"); - ppmm.addMessageListener("PresentationDeviceInfoManager:GetAll", this); - ppmm.addMessageListener("PresentationDeviceInfoManager:ForceDiscovery", this); - Services.obs.addObserver(this, "presentation-device-change"); - }, - - getAll: function(aData, aMm) { - log("getAll"); - let deviceArray = presentationDeviceManager.getAvailableDevices().QueryInterface(Ci.nsIArray); - if (!deviceArray) { - aData.error = "DataError"; - aMm.sendAsyncMessage("PresentationDeviceInfoManager:GetAll:Result:Error", aData); - return; - } - - aData.devices = []; - for (let i = 0; i < deviceArray.length; i++) { - let device = deviceArray.queryElementAt(i, Ci.nsIPresentationDevice); - aData.devices.push({ - id: device.id, - name: device.name, - type: device.type, - }); - } - aMm.sendAsyncMessage("PresentationDeviceInfoManager:GetAll:Result:Ok", aData); - }, - - forceDiscovery: function() { - log("forceDiscovery"); - presentationDeviceManager.forceDiscovery(); - }, - - observe: function(aSubject, aTopic, aData) { - log("observe: " + aTopic); - - let device = aSubject.QueryInterface(Ci.nsIPresentationDevice); - let data = { - type: aData, - deviceInfo: { - id: device.id, - name: device.name, - type: device.type, - }, - }; - ppmm.broadcastAsyncMessage("PresentationDeviceInfoManager:OnDeviceChange", data); - }, - - receiveMessage: function(aMessage) { - let msg = aMessage.data || {}; - let mm = aMessage.target; - - log("receiveMessage: " + aMessage.name); - switch (aMessage.name) { - case "PresentationDeviceInfoManager:GetAll": { - this.getAll(msg, mm); - break; - } - case "PresentationDeviceInfoManager:ForceDiscovery": { - this.forceDiscovery(); - break; - } - } - }, -}; - -this.PresentationDeviceInfoService.init(); diff --git a/dom/presentation/PresentationDeviceInfoManager.manifest b/dom/presentation/PresentationDeviceInfoManager.manifest deleted file mode 100644 index ae50b8e6a8c0..000000000000 --- a/dom/presentation/PresentationDeviceInfoManager.manifest +++ /dev/null @@ -1,3 +0,0 @@ -# PresentationDeviceInfoManager.js -component {1bd66bef-f643-4be3-b690-0c656353eafd} PresentationDeviceInfoManager.js -contract @mozilla.org/presentation-device/deviceInfo;1 {1bd66bef-f643-4be3-b690-0c656353eafd} diff --git a/dom/presentation/moz.build b/dom/presentation/moz.build index 4df53868951a..851a299b138a 100644 --- a/dom/presentation/moz.build +++ b/dom/presentation/moz.build @@ -63,8 +63,6 @@ UNIFIED_SOURCES += [ EXTRA_COMPONENTS += [ 'PresentationDataChannelSessionTransport.js', 'PresentationDataChannelSessionTransport.manifest', - 'PresentationDeviceInfoManager.js', - 'PresentationDeviceInfoManager.manifest', ] if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android': @@ -73,10 +71,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android': 'PresentationNetworkHelper.manifest', ] -EXTRA_JS_MODULES += [ - 'PresentationDeviceInfoManager.jsm', -] - IPDL_SOURCES += [ 'ipc/PPresentation.ipdl', 'ipc/PPresentationBuilder.ipdl', diff --git a/dom/presentation/tests/mochitest/PresentationDeviceInfoChromeScript.js b/dom/presentation/tests/mochitest/PresentationDeviceInfoChromeScript.js index 2bc069f6b22d..9498cb982387 100644 --- a/dom/presentation/tests/mochitest/PresentationDeviceInfoChromeScript.js +++ b/dom/presentation/tests/mochitest/PresentationDeviceInfoChromeScript.js @@ -5,8 +5,6 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; -Cu.import('resource://gre/modules/PresentationDeviceInfoManager.jsm'); - const { XPCOMUtils } = Cu.import('resource://gre/modules/XPCOMUtils.jsm'); const manager = Cc['@mozilla.org/presentation-device/manager;1'] diff --git a/dom/presentation/tests/mochitest/chrome.ini b/dom/presentation/tests/mochitest/chrome.ini index 83841f4f8c40..22ecc244ee76 100644 --- a/dom/presentation/tests/mochitest/chrome.ini +++ b/dom/presentation/tests/mochitest/chrome.ini @@ -5,7 +5,6 @@ support-files = [test_presentation_datachannel_sessiontransport.html] skip-if = os == 'android' -[test_presentation_device_info.html] [test_presentation_sender_startWithDevice.html] skip-if = toolkit == 'android' # Bug 1129785 [test_presentation_tcp_sender.html] diff --git a/dom/presentation/tests/mochitest/mochitest.ini b/dom/presentation/tests/mochitest/mochitest.ini index 8b2b3f2872c7..740fdd7e4dcf 100644 --- a/dom/presentation/tests/mochitest/mochitest.ini +++ b/dom/presentation/tests/mochitest/mochitest.ini @@ -39,7 +39,6 @@ skip-if = (e10s || toolkit == 'android') # Bug 1129785 skip-if = (e10s || toolkit == 'android') # Bug 1129785 [test_presentation_1ua_connection_wentaway_oop.html] skip-if = (e10s || toolkit == 'android') # Bug 1129785 -[test_presentation_device_info_permission.html] [test_presentation_tcp_sender_disconnect.html] skip-if = toolkit == 'android' # Bug 1129785 [test_presentation_tcp_sender_establish_connection_error.html] diff --git a/dom/presentation/tests/mochitest/test_presentation_device_info.html b/dom/presentation/tests/mochitest/test_presentation_device_info.html deleted file mode 100644 index 875f5a11f486..000000000000 --- a/dom/presentation/tests/mochitest/test_presentation_device_info.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - Test for B2G Presentation Device Info API - - - - -Test for B2G Presentation Device Info API - - - - diff --git a/dom/presentation/tests/mochitest/test_presentation_device_info_permission.html b/dom/presentation/tests/mochitest/test_presentation_device_info_permission.html deleted file mode 100644 index 31a870be1a57..000000000000 --- a/dom/presentation/tests/mochitest/test_presentation_device_info_permission.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - Test for B2G Presentation Device Info API Permission - - - - -Test for B2G Presentation Device Info API Permission - - - - diff --git a/dom/tests/mochitest/general/test_interfaces.js b/dom/tests/mochitest/general/test_interfaces.js index 8f8e81e05c78..39f8d29107fb 100644 --- a/dom/tests/mochitest/general/test_interfaces.js +++ b/dom/tests/mochitest/general/test_interfaces.js @@ -755,9 +755,6 @@ var interfaceNamesInGlobalScope = "PopupBlockedEvent", // IMPORTANT: Do not change this list without review from a DOM peer! {name: "PopupBoxObject", xbl: true}, -// IMPORTANT: Do not change this list without review from a DOM peer! - {name: "PresentationDeviceInfoManager", - disabled: true}, // IMPORTANT: Do not change this list without review from a DOM peer! {name: "Presentation", desktop: false, release: false }, // IMPORTANT: Do not change this list without review from a DOM peer! diff --git a/dom/webidl/PresentationDeviceInfoManager.webidl b/dom/webidl/PresentationDeviceInfoManager.webidl deleted file mode 100644 index 6ccace324711..000000000000 --- a/dom/webidl/PresentationDeviceInfoManager.webidl +++ /dev/null @@ -1,26 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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/. - */ - -dictionary PresentationDeviceInfo { - DOMString id; - DOMString name; - DOMString type; -}; - -[NavigatorProperty="mozPresentationDeviceInfo", - JSImplementation="@mozilla.org/presentation-device/deviceInfo;1", - Pref="dom.presentation.enabled", - ChromeOnly] -interface PresentationDeviceInfoManager : EventTarget { - // notify if any device updated. - attribute EventHandler ondevicechange; - - // retrieve all available device infos - Promise> getAll(); - - // Force all registered device provider to update device information. - void forceDiscovery(); -}; diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index 28855e744640..41cd5a1cbf8c 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -751,7 +751,6 @@ WEBIDL_FILES = [ 'PresentationAvailability.webidl', 'PresentationConnection.webidl', 'PresentationConnectionList.webidl', - 'PresentationDeviceInfoManager.webidl', 'PresentationReceiver.webidl', 'PresentationRequest.webidl', 'ProcessingInstruction.webidl', diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in index 7cd48b38202e..187aac21cf9b 100644 --- a/mobile/android/installer/package-manifest.in +++ b/mobile/android/installer/package-manifest.in @@ -395,8 +395,6 @@ @BINPATH@/components/DownloadLegacy.js #ifndef MOZ_GECKOVIEW_JAR -@BINPATH@/components/PresentationDeviceInfoManager.manifest -@BINPATH@/components/PresentationDeviceInfoManager.js @BINPATH@/components/BuiltinProviders.manifest @BINPATH@/components/PresentationControlService.js @BINPATH@/components/PresentationNetworkHelper.js diff --git a/tools/lint/eslint/modules.json b/tools/lint/eslint/modules.json index 1bccaa74fea9..5d8281639e15 100644 --- a/tools/lint/eslint/modules.json +++ b/tools/lint/eslint/modules.json @@ -167,7 +167,6 @@ "policies.js": ["ErrorHandler", "SyncScheduler"], "prefs.js": ["PrefsEngine", "PrefRec"], "prefs.jsm": ["Preference"], - "PresentationDeviceInfoManager.jsm": ["PresentationDeviceInfoService"], "ProfileStorage.jsm": ["profileStorage"], "PromiseWorker.jsm": ["BasePromiseWorker"], "PushCrypto.jsm": ["PushCrypto", "concatArray"],