Bug 1524688: Part 53 - Convert htmlMenuBuilder to static registration. r=mconley
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 11:33:07 -0800
changeset 459024 1e75ce91029b
parent 459023 34a978503b1d
child 459025 0ad5465eace1
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 53 - Convert htmlMenuBuilder to static registration. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D18463
browser/installer/package-manifest.in
dom/html/HTMLMenuBuilder.jsm
dom/html/components.conf
dom/html/htmlMenuBuilder.js
dom/html/htmlMenuBuilder.manifest
dom/html/moz.build
mobile/android/installer/package-manifest.in
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -205,18 +205,16 @@
 #ifdef XP_MACOSX
 @RESPATH@/browser/components/MacTouchBar.manifest
 @RESPATH@/browser/components/MacTouchBar.js
 #endif
 @RESPATH@/components/SyncComponents.manifest
 @RESPATH@/components/servicesComponents.manifest
 @RESPATH@/components/servicesSettings.manifest
 @RESPATH@/components/cryptoComponents.manifest
-@RESPATH@/components/htmlMenuBuilder.js
-@RESPATH@/components/htmlMenuBuilder.manifest
 
 @RESPATH@/components/Push.manifest
 
 @RESPATH@/components/ProcessSelector.js
 @RESPATH@/components/ProcessSelector.manifest
 
 @RESPATH@/components/SlowScriptDebug.manifest
 @RESPATH@/components/SlowScriptDebug.js
rename from dom/html/htmlMenuBuilder.js
rename to dom/html/HTMLMenuBuilder.jsm
--- a/dom/html/htmlMenuBuilder.js
+++ b/dom/html/HTMLMenuBuilder.jsm
@@ -1,16 +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/. */
 
 // This component is used to build the menus for the HTML contextmenu attribute.
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-
 // A global value that is used to identify each menu item. It is
 // incremented with each one that is found.
 var gGeneratedId = 1;
 
 function HTMLMenuBuilder() {
   this.currentNode = null;
   this.root = null;
   this.items = {};
@@ -126,9 +124,9 @@ HTMLMenuBuilder.prototype =
   click: function(id) {
     let item = this.items[id];
     if (item) {
       item.click();
     }
   }
 };
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([HTMLMenuBuilder]);
+var EXPORTED_SYMBOLS = ["HTMLMenuBuilder"];
new file mode 100644
--- /dev/null
+++ b/dom/html/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': '{51c65f5d-0de5-4edc-9058-60e50cef77f8}',
+        'contract_ids': ['@mozilla.org/content/html-menu-builder;1'],
+        'jsm': 'resource://gre/modules/HTMLMenuBuilder.jsm',
+        'constructor': 'HTMLMenuBuilder',
+    },
+]
deleted file mode 100644
--- a/dom/html/htmlMenuBuilder.manifest
+++ /dev/null
@@ -1,3 +0,0 @@
-component {51c65f5d-0de5-4edc-9058-60e50cef77f8} htmlMenuBuilder.js
-contract @mozilla.org/content/html-menu-builder;1 {51c65f5d-0de5-4edc-9058-60e50cef77f8}
-
--- a/dom/html/moz.build
+++ b/dom/html/moz.build
@@ -222,19 +222,22 @@ UNIFIED_SOURCES += [
     'VideoDocument.cpp',
 ]
 
 SOURCES += [
     # Includes npapi.h.
     'PluginDocument.cpp',
 ]
 
-EXTRA_COMPONENTS += [
-    'htmlMenuBuilder.js',
-    'htmlMenuBuilder.manifest'
+EXTRA_JS_MODULES += [
+    'HTMLMenuBuilder.jsm',
+]
+
+XPCOM_MANIFESTS += [
+    'components.conf',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 LOCAL_INCLUDES += [
     '/caps',
     '/docshell/base',
     '/dom/base',
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -133,19 +133,16 @@
 @BINPATH@/components/ProcessSingleton.manifest
 @BINPATH@/components/HandlerService.manifest
 @BINPATH@/components/HandlerService.js
 @BINPATH@/components/contentAreaDropListener.manifest
 @BINPATH@/components/contentAreaDropListener.js
 @BINPATH@/components/servicesComponents.manifest
 @BINPATH@/components/servicesSettings.manifest
 
-@BINPATH@/components/htmlMenuBuilder.js
-@BINPATH@/components/htmlMenuBuilder.manifest
-
 #if defined(ENABLE_TESTS) && defined(MOZ_DEBUG)
 @BINPATH@/components/TestInterfaceJS.js
 @BINPATH@/components/TestInterfaceJS.manifest
 @BINPATH@/components/TestInterfaceJSMaplike.js
 #endif
 
 ; Modules
 @BINPATH@/modules/*