Bug 1524688: Part 48 - Convert PresentationControlService to static registration. r=mconley
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 11:19:47 -0800
changeset 459020 978ef5dac9db
parent 459019 28105bf7bf6a
child 459021 12a9135dc005
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 48 - Convert PresentationControlService to static registration. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D18458
browser/installer/package-manifest.in
dom/presentation/provider/BuiltinProviders.manifest
dom/presentation/provider/PresentationControlService.js
dom/presentation/provider/PresentationControlService.jsm
dom/presentation/provider/components.conf
dom/presentation/provider/moz.build
mobile/android/installer/package-manifest.in
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -227,19 +227,16 @@
 #ifdef ENABLE_MARIONETTE
 @RESPATH@/chrome/marionette@JAREXT@
 @RESPATH@/chrome/marionette.manifest
 @RESPATH@/components/marionette.manifest
 @RESPATH@/components/marionette.js
 @RESPATH@/defaults/pref/marionette.js
 #endif
 
-@RESPATH@/components/BuiltinProviders.manifest
-@RESPATH@/components/PresentationControlService.js
-
 #if defined(ENABLE_TESTS) && defined(MOZ_DEBUG)
 @RESPATH@/components/TestInterfaceJS.js
 @RESPATH@/components/TestInterfaceJS.manifest
 @RESPATH@/components/TestInterfaceJSMaplike.js
 #endif
 
 #if defined(MOZ_DEBUG) || defined(MOZ_DEV_EDITION) || defined(NIGHTLY_BUILD)
 @RESPATH@/browser/components/testComponents.manifest
deleted file mode 100644
--- a/dom/presentation/provider/BuiltinProviders.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {f4079b8b-ede5-4b90-a112-5b415a931deb} PresentationControlService.js
-contract @mozilla.org/presentation/control-service;1 {f4079b8b-ede5-4b90-a112-5b415a931deb}
rename from dom/presentation/provider/PresentationControlService.js
rename to dom/presentation/provider/PresentationControlService.jsm
--- a/dom/presentation/provider/PresentationControlService.js
+++ b/dom/presentation/provider/PresentationControlService.jsm
@@ -1,14 +1,13 @@
 /* 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 {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 const {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
 const {clearTimeout, setTimeout} = ChromeUtils.import("resource://gre/modules/Timer.jsm");
 
 ChromeUtils.defineModuleGetter(this, "ControllerStateMachine",
                                "resource://gre/modules/presentation/ControllerStateMachine.jsm");
 ChromeUtils.defineModuleGetter(this, "ReceiverStateMachine",
                                "resource://gre/modules/presentation/ReceiverStateMachine.jsm");
@@ -942,9 +941,9 @@ TCPControlChannel.prototype = {
     this._listener.onIceCandidate(candidate);
   },
 
   classID: Components.ID("{fefb8286-0bdc-488b-98bf-0c11b485c955}"),
   QueryInterface: ChromeUtils.generateQI([Ci.nsIPresentationControlChannel,
                                           Ci.nsIStreamListener]),
 };
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PresentationControlService]); // jshint ignore:line
+var EXPORTED_SYMBOLS = ["PresentationControlService"];
--- a/dom/presentation/provider/components.conf
+++ b/dom/presentation/provider/components.conf
@@ -12,9 +12,15 @@ if buildconfig.substs['MOZ_WIDGET_TOOLKI
 Classes = [
     {
         'cid': '{814f947a-52f7-41c9-94a1-3684797284ac}',
         'contract_ids': ['@mozilla.org/presentation-device/multicastdns-provider;1'],
         'type': 'mozilla::dom::presentation::MulticastDNSDeviceProvider',
         'headers': ['/dom/presentation/provider/MulticastDNSDeviceProvider.h'],
         'categories': categories,
     },
+    {
+        'cid': '{f4079b8b-ede5-4b90-a112-5b415a931deb}',
+        'contract_ids': ['@mozilla.org/presentation/control-service;1'],
+        'jsm': 'resource://gre/modules/PresentationControlService.jsm',
+        'constructor': 'PresentationControlService',
+    },
 ]
--- a/dom/presentation/provider/moz.build
+++ b/dom/presentation/provider/moz.build
@@ -1,17 +1,16 @@
 # -*- 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/.
 
-EXTRA_COMPONENTS += [
-    'BuiltinProviders.manifest',
-    'PresentationControlService.js'
+EXTRA_JS_MODULES += [
+    'PresentationControlService.jsm'
 ]
 
 UNIFIED_SOURCES += [
     'DeviceProviderHelpers.cpp',
     'MulticastDNSDeviceProvider.cpp',
 ]
 
 XPCOM_MANIFESTS += [
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -145,18 +145,16 @@
 
 #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/BuiltinProviders.manifest
-@BINPATH@/components/PresentationControlService.js
 @BINPATH@/components/PresentationNetworkHelper.js
 @BINPATH@/components/PresentationNetworkHelper.manifest
 @BINPATH@/components/AndroidCastDeviceProvider.manifest
 @BINPATH@/components/AndroidCastDeviceProvider.js
 #endif
 
 ; Modules
 @BINPATH@/modules/*