Bug 1524688: Part 57 - Convert ProcessSelector to static registration. r=mconley
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 11:41:05 -0800
changeset 459028 b4938f2ff8fd
parent 459027 230d2feaf941
child 459029 92877cf4fe33
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 57 - Convert ProcessSelector to static registration. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D18467
browser/installer/package-manifest.in
dom/base/ProcessSelector.js
dom/base/ProcessSelector.jsm
dom/base/ProcessSelector.manifest
dom/base/components.conf
dom/base/moz.build
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -202,19 +202,16 @@
 #endif
 @RESPATH@/components/SyncComponents.manifest
 @RESPATH@/components/servicesComponents.manifest
 @RESPATH@/components/servicesSettings.manifest
 @RESPATH@/components/cryptoComponents.manifest
 
 @RESPATH@/components/Push.manifest
 
-@RESPATH@/components/ProcessSelector.js
-@RESPATH@/components/ProcessSelector.manifest
-
 @RESPATH@/components/SlowScriptDebug.manifest
 @RESPATH@/components/SlowScriptDebug.js
 
 ; Remote control protocol
 #ifdef ENABLE_MARIONETTE
 @RESPATH@/chrome/marionette@JAREXT@
 @RESPATH@/chrome/marionette.manifest
 @RESPATH@/components/marionette.manifest
rename from dom/base/ProcessSelector.js
rename to dom/base/ProcessSelector.jsm
--- a/dom/base/ProcessSelector.js
+++ b/dom/base/ProcessSelector.jsm
@@ -1,14 +1,12 @@
 /* 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/. */
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-
 // Fills up aProcesses until max and then selects randomly from the available
 // ones.
 function RandomSelector() {
 }
 
 RandomSelector.prototype = {
   classID:          Components.ID("{c616fcfd-9737-41f1-aa74-cee72a38f91b}"),
   QueryInterface:   ChromeUtils.generateQI([Ci.nsIContentProcessProvider]),
@@ -63,10 +61,9 @@ MinTabSelector.prototype = {
         candidate = i;
       }
     }
 
     return candidate;
   },
 };
 
-var components = [RandomSelector, MinTabSelector];
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
+var EXPORTED_SYMBOLS = ["RandomSelector", "MinTabSelector"]
deleted file mode 100644
--- a/dom/base/ProcessSelector.manifest
+++ /dev/null
@@ -1,3 +0,0 @@
-component {c616fcfd-9737-41f1-aa74-cee72a38f91b} ProcessSelector.js
-component {2dc08eaf-6eef-4394-b1df-a3a927c1290b} ProcessSelector.js
-contract @mozilla.org/ipc/processselector;1 {2dc08eaf-6eef-4394-b1df-a3a927c1290b}
--- a/dom/base/components.conf
+++ b/dom/base/components.conf
@@ -6,9 +6,20 @@
 
 Classes = [
     {
         'cid': '{1f34bc80-1bc7-11d6-a384-d705dd0746fc}',
         'contract_ids': ['@mozilla.org/content/dropped-link-handler;1'],
         'jsm': 'resource://gre/modules/ContentAreaDropListener.jsm',
         'constructor': 'ContentAreaDropListener',
     },
+    {
+        'cid': '{c616fcfd-9737-41f1-aa74-cee72a38f91b}',
+        'jsm': 'resource://gre/modules/ProcessSelector.jsm',
+        'constructor': 'RandomSelector',
+    },
+    {
+        'cid': '{2dc08eaf-6eef-4394-b1df-a3a927c1290b}',
+        'contract_ids': ['@mozilla.org/ipc/processselector;1'],
+        'jsm': 'resource://gre/modules/ProcessSelector.jsm',
+        'constructor': 'MinTabSelector',
+    },
 ]
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -448,26 +448,25 @@ SOURCES += [
 
 # Are we targeting x86-32 or x86-64?  If so, we want to include SSE2 code for
 # nsTextFragment.cpp
 if CONFIG['INTEL_ARCHITECTURE']:
     SOURCES += ['nsTextFragmentSSE2.cpp']
     SOURCES['nsTextFragmentSSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
 
 EXTRA_COMPONENTS += [
-    'ProcessSelector.js',
-    'ProcessSelector.manifest',
     'SlowScriptDebug.js',
     'SlowScriptDebug.manifest',
 ]
 
 EXTRA_JS_MODULES += [
     'ContentAreaDropListener.jsm',
     'DOMRequestHelper.jsm',
     'IndexedDBHelper.jsm',
+    'ProcessSelector.jsm',
 ]
 
 XPCOM_MANIFESTS += [
     'components.conf',
 ]
 
 LOCAL_INCLUDES += [
     '../battery',