Bug 1524688: Part 62 - Convert ContentDispatchChooser to static registration. r=mconley
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 13:23:34 -0800
changeset 459033 fb23a0271da0
parent 459032 0c1d1248e59e
child 459034 c7c49f64048f
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 62 - Convert ContentDispatchChooser to static registration. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D18472
browser/installer/package-manifest.in
mobile/android/installer/package-manifest.in
toolkit/moz.build
toolkit/mozapps/handling/ContentDispatchChooser.jsm
toolkit/mozapps/handling/components.conf
toolkit/mozapps/handling/moz.build
toolkit/mozapps/handling/nsContentDispatchChooser.js
toolkit/mozapps/handling/nsContentDispatchChooser.manifest
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -169,18 +169,16 @@
 @RESPATH@/components/WebVTTParserWrapper.js
 @RESPATH@/components/nsHelperAppDlg.manifest
 @RESPATH@/components/nsHelperAppDlg.js
 @RESPATH@/components/extensions.manifest
 #ifdef MOZ_UPDATER
 @RESPATH@/components/nsUpdateService.manifest
 #endif
 @RESPATH@/components/ProcessSingleton.manifest
-@RESPATH@/components/nsContentDispatchChooser.manifest
-@RESPATH@/components/nsContentDispatchChooser.js
 @RESPATH@/components/HandlerService.manifest
 @RESPATH@/components/HandlerService.js
 #ifdef XP_MACOSX
 @RESPATH@/browser/components/MacTouchBar.manifest
 @RESPATH@/browser/components/MacTouchBar.js
 #endif
 @RESPATH@/components/SyncComponents.manifest
 @RESPATH@/components/servicesComponents.manifest
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -238,17 +238,16 @@
 #else
 @BINPATH@/chrome/chrome@JAREXT@
 @BINPATH@/chrome/chrome.manifest
 @BINPATH@/components/AboutRedirector.js
 @BINPATH@/components/AddonUpdateService.js
 @BINPATH@/components/BlocklistPrompt.js
 @BINPATH@/components/BrowserCLH.js
 @BINPATH@/components/ColorPicker.js
-@BINPATH@/components/ContentDispatchChooser.js
 @BINPATH@/components/ContentPermissionPrompt.js
 @BINPATH@/components/ImageBlockingPolicy.js
 @BINPATH@/components/DirectoryProvider.js
 @BINPATH@/components/FilePicker.js
 @BINPATH@/components/HelperAppDialog.js
 @BINPATH@/components/LoginManagerPrompter.js
 @BINPATH@/components/MobileComponents.manifest
 @BINPATH@/components/NSSDialogService.js
--- a/toolkit/moz.build
+++ b/toolkit/moz.build
@@ -9,17 +9,16 @@ DIRS += [
     'components',
     'content',
     'crashreporter',
     'forgetaboutsite',
     'locales',
     'modules',
     'mozapps/downloads',
     'mozapps/extensions',
-    'mozapps/handling',
     'mozapps/preferences',
     'pluginproblem',
     'profile',
     'recordreplay',
     'themes',
 ]
 
 if CONFIG['MOZ_UPDATER'] and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
@@ -32,16 +31,18 @@ if CONFIG['MOZ_MAINTENANCE_SERVICE'] or 
 
 if CONFIG['MOZ_MAINTENANCE_SERVICE']:
     DIRS += [
         'components/maintenanceservice'
     ]
 
 DIRS += ['xre']
 
+if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
+    DIRS += ['mozapps/handling']
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
     DIRS += ['system/unixproxy']
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     DIRS += ['system/osxproxy']
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     DIRS += ['system/windowsproxy',
             'system/windowsDHCPClient']
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
rename from toolkit/mozapps/handling/nsContentDispatchChooser.js
rename to toolkit/mozapps/handling/ContentDispatchChooser.jsm
--- a/toolkit/mozapps/handling/nsContentDispatchChooser.js
+++ b/toolkit/mozapps/handling/ContentDispatchChooser.jsm
@@ -1,15 +1,14 @@
 /* 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/. */
 
 // Constants
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const CONTENT_HANDLING_URL = "chrome://mozapps/content/handling/dialog.xul";
 const STRINGBUNDLE_URL = "chrome://mozapps/locale/handling/handling.properties";
 
 // nsContentDispatchChooser class
 
 function nsContentDispatchChooser() {
@@ -62,13 +61,9 @@ nsContentDispatchChooser.prototype =
                            params);
   },
 
   // nsISupports
 
   QueryInterface: ChromeUtils.generateQI([Ci.nsIContentDispatchChooser]),
 };
 
-// Module
-
-var components = [nsContentDispatchChooser];
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
+var EXPORTED_SYMBOLS = ["nsContentDispatchChooser"];
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/handling/components.conf
@@ -0,0 +1,14 @@
+# -*- 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/.
+
+Classes = [
+    {
+        'cid': '{e35d5067-95bc-4029-8432-e8f1e431148d}',
+        'contract_ids': ['@mozilla.org/content-dispatch-chooser;1'],
+        'jsm': 'resource://gre/modules/ContentDispatchChooser.jsm',
+        'constructor': 'nsContentDispatchChooser',
+    },
+]
--- a/toolkit/mozapps/handling/moz.build
+++ b/toolkit/mozapps/handling/moz.build
@@ -2,14 +2,17 @@
 # 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/.
 
 with Files('**'):
     BUG_COMPONENT = ('Firefox', 'File Handling')
 
-EXTRA_COMPONENTS += [
-    'nsContentDispatchChooser.js',
-    'nsContentDispatchChooser.manifest',
+EXTRA_JS_MODULES += [
+    'ContentDispatchChooser.jsm',
 ]
 
-JAR_MANIFESTS += ['jar.mn']
\ No newline at end of file
+XPCOM_MANIFESTS += [
+    'components.conf',
+]
+
+JAR_MANIFESTS += ['jar.mn']
deleted file mode 100644
--- a/toolkit/mozapps/handling/nsContentDispatchChooser.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {e35d5067-95bc-4029-8432-e8f1e431148d} nsContentDispatchChooser.js
-contract @mozilla.org/content-dispatch-chooser;1 {e35d5067-95bc-4029-8432-e8f1e431148d}