Bug 1524688: Part 49 - Convert AndroidCastDataProvider to static registration. r=snorp
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 11:22:18 -0800
changeset 459021 12a9135dc005
parent 459020 978ef5dac9db
child 459022 183602e8a30b
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)
reviewerssnorp
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 49 - Convert AndroidCastDataProvider to static registration. r=snorp Differential Revision: https://phabricator.services.mozilla.com/D18459
dom/presentation/provider/AndroidCastDeviceProvider.js
dom/presentation/provider/AndroidCastDeviceProvider.jsm
dom/presentation/provider/AndroidCastDeviceProvider.manifest
dom/presentation/provider/components.conf
dom/presentation/provider/moz.build
mobile/android/installer/package-manifest.in
rename from dom/presentation/provider/AndroidCastDeviceProvider.js
rename to dom/presentation/provider/AndroidCastDeviceProvider.jsm
--- a/dom/presentation/provider/AndroidCastDeviceProvider.js
+++ b/dom/presentation/provider/AndroidCastDeviceProvider.jsm
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 {EventDispatcher} = ChromeUtils.import("resource://gre/modules/Messaging.jsm");
 
 function log(str) {
   // dump("-*- AndroidCastDeviceProvider -*-: " + str + "\n");
 }
 
 // Helper function: transfer nsIPresentationChannelDescription to json
@@ -455,9 +454,9 @@ AndroidCastDeviceProvider.prototype = {
     }
   },
 
   classID: Components.ID("{7394f24c-dbc3-48c8-8a47-cd10169b7c6b}"),
   QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
                                           Ci.nsIPresentationDeviceProvider]),
 };
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AndroidCastDeviceProvider]);
+var EXPORTED_SYMBOLS = ["AndroidCastDeviceProvider"];
deleted file mode 100644
--- a/dom/presentation/provider/AndroidCastDeviceProvider.manifest
+++ /dev/null
@@ -1,4 +0,0 @@
-# AndroidCastDeviceProvider.js
-component {7394f24c-dbc3-48c8-8a47-cd10169b7c6b} AndroidCastDeviceProvider.js
-contract @mozilla.org/presentation-device/android-cast-device-provider;1 {7394f24c-dbc3-48c8-8a47-cd10169b7c6b}
-category presentation-device-provider AndroidCastDeviceProvider @mozilla.org/presentation-device/android-cast-device-provider;1
--- a/dom/presentation/provider/components.conf
+++ b/dom/presentation/provider/components.conf
@@ -19,8 +19,19 @@ Classes = [
     },
     {
         'cid': '{f4079b8b-ede5-4b90-a112-5b415a931deb}',
         'contract_ids': ['@mozilla.org/presentation/control-service;1'],
         'jsm': 'resource://gre/modules/PresentationControlService.jsm',
         'constructor': 'PresentationControlService',
     },
 ]
+
+if buildconfig.substs['MOZ_WIDGET_TOOLKIT'] == 'android':
+    Classes += [
+        {
+            'cid': '{7394f24c-dbc3-48c8-8a47-cd10169b7c6b}',
+            'contract_ids': ['@mozilla.org/presentation-device/android-cast-device-provider;1'],
+            'jsm': 'resource://gre/modules/AndroidCastDeviceProvider.jsm',
+            'constructor': 'AndroidCastDeviceProvider',
+            'categories': {'presentation-device-provider': 'AndroidCastDeviceProvider'},
+        },
+    ]
--- a/dom/presentation/provider/moz.build
+++ b/dom/presentation/provider/moz.build
@@ -19,16 +19,15 @@ XPCOM_MANIFESTS += [
 
 EXTRA_JS_MODULES.presentation += [
     'ControllerStateMachine.jsm',
     'ReceiverStateMachine.jsm',
     'StateMachineHelper.jsm',
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
-    EXTRA_COMPONENTS += [
+    EXTRA_JS_MODULES += [
         # For android presentation device
-        'AndroidCastDeviceProvider.js',
-        'AndroidCastDeviceProvider.manifest',
+        'AndroidCastDeviceProvider.jsm',
     ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 FINAL_LIBRARY = 'xul'
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -147,18 +147,16 @@
 @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
-@BINPATH@/components/AndroidCastDeviceProvider.manifest
-@BINPATH@/components/AndroidCastDeviceProvider.js
 #endif
 
 ; Modules
 @BINPATH@/modules/*
 @BINPATH@/actors/*
 
 ; Security Reports
 @BINPATH@/components/SecurityReporter.manifest