Bug 1524688: Part 31 - Convert ShieldContentProcess to static registration. r=mythmon
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 10:29:16 -0800
changeset 459003 df02f7d25212
parent 459002 c9846136d105
child 459004 5746311ef859
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)
reviewersmythmon
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 31 - Convert ShieldContentProcess to static registration. r=mythmon
browser/installer/package-manifest.in
toolkit/components/normandy/ShieldContentProcess.jsm
toolkit/components/normandy/components.conf
toolkit/components/normandy/moz.build
toolkit/components/normandy/shield-content-process.js
toolkit/components/normandy/shield.manifest
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -278,20 +278,16 @@
 @RESPATH@/browser/components/testComponents.manifest
 @RESPATH@/browser/components/startupRecorder.js
 #endif
 
 ; [Extensions]
 @RESPATH@/components/extensions-toolkit.manifest
 @RESPATH@/browser/components/extensions-browser.manifest
 
-; [Normandy]
-@RESPATH@/components/shield.manifest
-@RESPATH@/components/shield-content-process.js
-
 ; Modules
 @RESPATH@/browser/modules/*
 @RESPATH@/modules/*
 @RESPATH@/browser/actors/*
 @RESPATH@/actors/*
 
 ; Security Reports
 @RESPATH@/components/SecurityReporter.manifest
rename from toolkit/components/normandy/shield-content-process.js
rename to toolkit/components/normandy/ShieldContentProcess.jsm
--- a/toolkit/components/normandy/shield-content-process.js
+++ b/toolkit/components/normandy/ShieldContentProcess.jsm
@@ -6,21 +6,15 @@
 /**
  * Registers about: pages provided by Shield, and listens for a shutdown event
  * from the add-on before un-registering them.
  *
  * This file is loaded as a process script. It is executed once for each
  * process, including the parent one.
  */
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {AboutPages} = ChromeUtils.import("resource://normandy-content/AboutPages.jsm");
 
-// generateNSGetFactory only knows how to register factory classes, with
-// classID properties on their prototype, and a constructor that returns
-// an instance. It can't handle singletons directly. So wrap the
-// aboutStudies singleton in a trivial constructor function.
 function AboutStudies() {
-  return AboutStudies.prototype;
+  return AboutPages.aboutStudies;
 }
-AboutStudies.prototype = AboutPages.aboutStudies;
 
-var NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutStudies]);
+var EXPORTED_SYMBOLS = ["AboutStudies"];
new file mode 100644
--- /dev/null
+++ b/toolkit/components/normandy/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': '{6ab96943-a163-482c-9622-4faedc0e827f}',
+        'contract_ids': ['@mozilla.org/network/protocol/about;1?what=studies'],
+        'jsm': 'resource://gre/modules/ShieldContentProcess.jsm',
+        'constructor': 'AboutStudies',
+    },
+]
--- a/toolkit/components/normandy/moz.build
+++ b/toolkit/components/normandy/moz.build
@@ -4,17 +4,20 @@
 # 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', 'Normandy Client')
 
 JAR_MANIFESTS += ['jar.mn']
 
-EXTRA_COMPONENTS += [
-    'shield-content-process.js',
-    'shield.manifest',
+EXTRA_JS_MODULES += [
+    'ShieldContentProcess.jsm',
+]
+
+XPCOM_MANIFESTS += [
+    'components.conf',
 ]
 
 SPHINX_TREES['normandy'] = 'docs'
 
 BROWSER_CHROME_MANIFESTS += ['test/browser/browser.ini']
 XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
deleted file mode 100644
--- a/toolkit/components/normandy/shield.manifest
+++ /dev/null
@@ -1,3 +0,0 @@
-
-component {6ab96943-a163-482c-9622-4faedc0e827f} shield-content-process.js
-contract @mozilla.org/network/protocol/about;1?what=studies {6ab96943-a163-482c-9622-4faedc0e827f}