Bug 1524688: Part 50 - Convert PresentationNetworkHelper to static registration. r=mconley
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 11:24:40 -0800
changeset 459022 183602e8a30b
parent 459021 12a9135dc005
child 459023 34a978503b1d
push id111909
push usermaglione.k@gmail.com
push dateThu, 14 Feb 2019 02:30:40 +0000
treeherdermozilla-inbound@81dc12cc9257 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1524688
milestone67.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 1524688: Part 50 - Convert PresentationNetworkHelper to static registration. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D18460
dom/presentation/PresentationNetworkHelper.js
dom/presentation/PresentationNetworkHelper.jsm
dom/presentation/PresentationNetworkHelper.manifest
dom/presentation/components.conf
dom/presentation/moz.build
mobile/android/installer/package-manifest.in
rename from dom/presentation/PresentationNetworkHelper.js
rename to dom/presentation/PresentationNetworkHelper.jsm
--- a/dom/presentation/PresentationNetworkHelper.js
+++ b/dom/presentation/PresentationNetworkHelper.jsm
@@ -1,26 +1,22 @@
 // -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*-
 /* 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 {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) {
     EventDispatcher.instance.sendRequestForResult({type: "Wifi:GetIPAddress"})
              .then(result => aListener.onGetWifiIPAddress(result),
                    err => aListener.onError(err));
   },
 };
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PresentationNetworkHelper]);
+var EXPORTED_SYMBOLS = ["PresentationNetworkHelper"];
deleted file mode 100644
--- 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}
--- a/dom/presentation/components.conf
+++ b/dom/presentation/components.conf
@@ -13,8 +13,18 @@ Classes = [
     },
     {
         'cid': '{215b2f62-46e2-4004-a3d1-6858e56c20f3}',
         'contract_ids': ['@mozilla.org/presentation/datachanneltransportbuilder;1'],
         'jsm': 'resource://gre/modules/PresentationDataChannelSessionTransport.jsm',
         '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',
+        },
+    ]
--- a/dom/presentation/moz.build
+++ b/dom/presentation/moz.build
@@ -64,19 +64,18 @@ EXTRA_JS_MODULES += [
     'PresentationDataChannelSessionTransport.jsm',
 ]
 
 XPCOM_MANIFESTS += [
     'components.conf',
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
-    EXTRA_COMPONENTS += [
-        'PresentationNetworkHelper.js',
-        'PresentationNetworkHelper.manifest',
+    EXTRA_JS_MODULES += [
+        'PresentationNetworkHelper.jsm',
     ]
 
 IPDL_SOURCES += [
     'ipc/PPresentation.ipdl',
     'ipc/PPresentationBuilder.ipdl',
     'ipc/PPresentationRequest.ipdl'
 ]
 
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -144,21 +144,16 @@
 @BINPATH@/components/htmlMenuBuilder.manifest
 
 #if defined(ENABLE_TESTS) && defined(MOZ_DEBUG)
 @BINPATH@/components/TestInterfaceJS.js
 @BINPATH@/components/TestInterfaceJS.manifest
 @BINPATH@/components/TestInterfaceJSMaplike.js
 #endif
 
-#ifndef MOZ_GECKOVIEW_JAR
-@BINPATH@/components/PresentationNetworkHelper.js
-@BINPATH@/components/PresentationNetworkHelper.manifest
-#endif
-
 ; Modules
 @BINPATH@/modules/*
 @BINPATH@/actors/*
 
 ; Security Reports
 @BINPATH@/components/SecurityReporter.manifest
 @BINPATH@/components/SecurityReporter.js