Bug 1524688: Part 61 - Convert AboutNewTabService to static registration. r=mconley
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 11:57:47 -0800
changeset 459032 0c1d1248e59e
parent 459031 9e9ec7de4160
child 459033 fb23a0271da0
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 61 - Convert AboutNewTabService to static registration. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D18471
browser/components/newtab/AboutNewTabService.jsm
browser/components/newtab/NewTabComponents.manifest
browser/components/newtab/aboutNewTabService.js
browser/components/newtab/components.conf
browser/components/newtab/moz.build
browser/installer/package-manifest.in
rename from browser/components/newtab/aboutNewTabService.js
rename to browser/components/newtab/AboutNewTabService.jsm
--- a/browser/components/newtab/aboutNewTabService.js
+++ b/browser/components/newtab/AboutNewTabService.jsm
@@ -356,9 +356,9 @@ AboutNewTabService.prototype = {
     Services.prefs.removeObserver(PREF_ACTIVITY_STREAM_PRERENDER_ENABLED, this);
     if (!IS_RELEASE_OR_BETA) {
       Services.prefs.removeObserver(PREF_ACTIVITY_STREAM_DEBUG, this);
     }
     this.initialized = false;
   },
 };
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutNewTabService]);
+var EXPORTED_SYMBOLS = ["AboutNewTabService"];
deleted file mode 100644
--- a/browser/components/newtab/NewTabComponents.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {dfcd2adc-7867-4d3a-ba70-17501f208142} aboutNewTabService.js
-contract @mozilla.org/browser/aboutnewtab-service;1 {dfcd2adc-7867-4d3a-ba70-17501f208142}
new file mode 100644
--- /dev/null
+++ b/browser/components/newtab/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': '{dfcd2adc-7867-4d3a-ba70-17501f208142}',
+        'contract_ids': ['@mozilla.org/browser/aboutnewtab-service;1'],
+        'jsm': 'resource:///modules/AboutNewTabService.jsm',
+        'constructor': 'AboutNewTabService',
+    },
+]
--- a/browser/components/newtab/moz.build
+++ b/browser/components/newtab/moz.build
@@ -14,14 +14,17 @@ XPCSHELL_TESTS_MANIFESTS += [
 ]
 
 XPIDL_SOURCES += [
     'nsIAboutNewTabService.idl',
 ]
 
 XPIDL_MODULE = 'browser-newtab'
 
-EXTRA_COMPONENTS += [
-    'aboutNewTabService.js',
-    'NewTabComponents.manifest',
+EXTRA_JS_MODULES += [
+    'AboutNewTabService.jsm',
+]
+
+XPCOM_MANIFESTS += [
+    'components.conf',
 ]
 
 JAR_MANIFESTS += ['jar.mn']
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -156,18 +156,16 @@
 @BINPATH@/AccessibleHandler.dll
 @BINPATH@/AccessibleMarshal.dll
 @BINPATH@/IA2Marshal.dll
 #endif
 #endif
 
 ; JavaScript components
 @RESPATH@/browser/components/BrowserComponents.manifest
-@RESPATH@/browser/components/aboutNewTabService.js
-@RESPATH@/browser/components/NewTabComponents.manifest
 @RESPATH@/browser/components/EnterprisePolicies.js
 @RESPATH@/browser/components/EnterprisePoliciesContent.js
 @RESPATH@/browser/components/EnterprisePolicies.manifest
 @RESPATH@/components/toolkitsearch.manifest
 @RESPATH@/components/WebVTT.manifest
 @RESPATH@/components/WebVTTParserWrapper.js
 @RESPATH@/components/nsHelperAppDlg.manifest
 @RESPATH@/components/nsHelperAppDlg.js