From 580a4759d6bb1ba76b04376f1768297c36eba0cc Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 30 Jan 2019 11:24:40 -0800 Subject: [PATCH] Bug 1524688: Part 50 - Convert PresentationNetworkHelper to static registration. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D18460 --HG-- rename : dom/presentation/PresentationNetworkHelper.js => dom/presentation/PresentationNetworkHelper.jsm extra : source : 183602e8a30b527608f2c862601abd83f275e636 --- ...nNetworkHelper.js => PresentationNetworkHelper.jsm} | 6 +----- dom/presentation/PresentationNetworkHelper.manifest | 3 --- dom/presentation/components.conf | 10 ++++++++++ dom/presentation/moz.build | 5 ++--- mobile/android/installer/package-manifest.in | 5 ----- 5 files changed, 13 insertions(+), 16 deletions(-) rename dom/presentation/{PresentationNetworkHelper.js => PresentationNetworkHelper.jsm} (74%) delete mode 100644 dom/presentation/PresentationNetworkHelper.manifest diff --git a/dom/presentation/PresentationNetworkHelper.js b/dom/presentation/PresentationNetworkHelper.jsm similarity index 74% rename from dom/presentation/PresentationNetworkHelper.js rename to dom/presentation/PresentationNetworkHelper.jsm index 0bd6853d3340..19785b36ee88 100644 --- a/dom/presentation/PresentationNetworkHelper.js +++ b/dom/presentation/PresentationNetworkHelper.jsm @@ -6,14 +6,10 @@ "use strict"; const {EventDispatcher} = ChromeUtils.import("resource://gre/modules/Messaging.jsm"); -const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); - -const NETWORKHELPER_CID = Components.ID("{5fb96caa-6d49-4f6b-9a4b-65dd0d51f92d}"); function PresentationNetworkHelper() {} PresentationNetworkHelper.prototype = { - classID: NETWORKHELPER_CID, QueryInterface: ChromeUtils.generateQI([Ci.nsIPresentationNetworkHelper]), getWifiIPAddress(aListener) { @@ -23,4 +19,4 @@ PresentationNetworkHelper.prototype = { }, }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PresentationNetworkHelper]); +var EXPORTED_SYMBOLS = ["PresentationNetworkHelper"]; diff --git a/dom/presentation/PresentationNetworkHelper.manifest b/dom/presentation/PresentationNetworkHelper.manifest deleted file mode 100644 index a061cef08f32..000000000000 --- a/dom/presentation/PresentationNetworkHelper.manifest +++ /dev/null @@ -1,3 +0,0 @@ -# PresentationNetworkHelper.js -component {5fb96caa-6d49-4f6b-9a4b-65dd0d51f92d} PresentationNetworkHelper.js -contract @mozilla.org/presentation-device/networkHelper;1 {5fb96caa-6d49-4f6b-9a4b-65dd0d51f92d} diff --git a/dom/presentation/components.conf b/dom/presentation/components.conf index 67309b6e6e7e..a20b93c77328 100644 --- a/dom/presentation/components.conf +++ b/dom/presentation/components.conf @@ -18,3 +18,13 @@ Classes = [ 'constructor': 'PresentationTransportBuilder', }, ] + +if buildconfig.substs['MOZ_WIDGET_TOOLKIT'] == 'android': + Classes += [ + { + 'cid': '{5fb96caa-6d49-4f6b-9a4b-65dd0d51f92d}', + 'contract_ids': ['@mozilla.org/presentation-device/networkHelper;1'], + 'jsm': 'resource://gre/modules/PresentationNetworkHelper.jsm', + 'constructor': 'PresentationNetworkHelper', + }, + ] diff --git a/dom/presentation/moz.build b/dom/presentation/moz.build index fec32ed192d9..b5c8dbd0b8bf 100644 --- a/dom/presentation/moz.build +++ b/dom/presentation/moz.build @@ -69,9 +69,8 @@ XPCOM_MANIFESTS += [ ] if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android': - EXTRA_COMPONENTS += [ - 'PresentationNetworkHelper.js', - 'PresentationNetworkHelper.manifest', + EXTRA_JS_MODULES += [ + 'PresentationNetworkHelper.jsm', ] IPDL_SOURCES += [ diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in index a058ac436586..ab4e337f3c64 100644 --- a/mobile/android/installer/package-manifest.in +++ b/mobile/android/installer/package-manifest.in @@ -149,11 +149,6 @@ @BINPATH@/components/TestInterfaceJSMaplike.js #endif -#ifndef MOZ_GECKOVIEW_JAR -@BINPATH@/components/PresentationNetworkHelper.js -@BINPATH@/components/PresentationNetworkHelper.manifest -#endif - ; Modules @BINPATH@/modules/* @BINPATH@/actors/*