Bug 1524688: Part 51 - Convert NotificationStorage to static registration. r=mconley
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 11:27:51 -0800
changeset 459023 34a978503b1d
parent 459022 183602e8a30b
child 459024 1e75ce91029b
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 51 - Convert NotificationStorage to static registration. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D18461
browser/installer/package-manifest.in
dom/notification/NotificationStorage.js
dom/notification/NotificationStorage.jsm
dom/notification/NotificationStorage.manifest
dom/notification/components.conf
dom/notification/moz.build
mobile/android/installer/package-manifest.in
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -208,18 +208,16 @@
 #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/NotificationStorage.js
-@RESPATH@/components/NotificationStorage.manifest
 @RESPATH@/components/Push.manifest
 
 @RESPATH@/components/ProcessSelector.js
 @RESPATH@/components/ProcessSelector.manifest
 
 @RESPATH@/components/SlowScriptDebug.manifest
 @RESPATH@/components/SlowScriptDebug.js
 
rename from dom/notification/NotificationStorage.js
rename to dom/notification/NotificationStorage.jsm
--- a/dom/notification/NotificationStorage.js
+++ b/dom/notification/NotificationStorage.jsm
@@ -2,21 +2,16 @@
  * 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/. */
 
 "use strict";
 
 const DEBUG = false;
 function debug(s) { dump("-*- NotificationStorage.js: " + s + "\n"); }
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-const NOTIFICATIONSTORAGE_CID = "{37f819b0-0b5c-11e3-8ffd-0800200c9a66}";
-const NOTIFICATIONSTORAGE_CONTRACTID = "@mozilla.org/notificationStorage;1";
-
 ChromeUtils.defineModuleGetter(this, "Services",
                                "resource://gre/modules/Services.jsm");
 
 const kMessageNotificationGetAllOk = "Notification:GetAll:Return:OK";
 const kMessageNotificationGetAllKo = "Notification:GetAll:Return:KO";
 const kMessageNotificationSaveKo   = "Notification:Save:Return:KO";
 const kMessageNotificationDeleteKo = "Notification:Delete:Return:KO";
 
@@ -186,15 +181,13 @@ NotificationStorage.prototype = {
     });
     try {
       Services.tm.dispatchToMainThread(callback.done);
     } catch (e) {
       if (DEBUG) { debug("Error calling callback done: " + e); }
     }
   },
 
-  classID : Components.ID(NOTIFICATIONSTORAGE_CID),
-  contractID : NOTIFICATIONSTORAGE_CONTRACTID,
   QueryInterface: ChromeUtils.generateQI([Ci.nsINotificationStorage]),
 };
 
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([NotificationStorage]);
+var EXPORTED_SYMBOLS = ["NotificationStorage"];
deleted file mode 100644
--- a/dom/notification/NotificationStorage.manifest
+++ /dev/null
@@ -1,3 +0,0 @@
-# NotificationStorage.js
-component {37f819b0-0b5c-11e3-8ffd-0800200c9a66} NotificationStorage.js
-contract @mozilla.org/notificationStorage;1 {37f819b0-0b5c-11e3-8ffd-0800200c9a66}
new file mode 100644
--- /dev/null
+++ b/dom/notification/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': '{37f819b0-0b5c-11e3-8ffd-0800200c9a66}',
+        'contract_ids': ['@mozilla.org/notificationStorage;1'],
+        'jsm': 'resource://gre/modules/NotificationStorage.jsm',
+        'constructor': 'NotificationStorage',
+    },
+]
--- a/dom/notification/moz.build
+++ b/dom/notification/moz.build
@@ -2,23 +2,23 @@
 # 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 = ("Toolkit", "Notifications and Alerts")
 
-EXTRA_COMPONENTS += [
-    'NotificationStorage.js',
-    'NotificationStorage.manifest',
+EXTRA_JS_MODULES += [
+    'NotificationDB.jsm',
+    'NotificationStorage.jsm',
 ]
 
-EXTRA_JS_MODULES += [
-    'NotificationDB.jsm'
+XPCOM_MANIFESTS += [
+    'components.conf',
 ]
 
 EXPORTS.mozilla.dom += [
     'Notification.h',
     'NotificationEvent.h',
 ]
 
 UNIFIED_SOURCES += [
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -98,18 +98,16 @@
 @BINPATH@/defaults/settings/blocklists/certificates.json
 
 ; [Components]
 @BINPATH@/components/components.manifest
 
 ; JavaScript components
 @BINPATH@/components/ConsoleAPI.manifest
 @BINPATH@/components/ConsoleAPIStorage.js
-@BINPATH@/components/NotificationStorage.js
-@BINPATH@/components/NotificationStorage.manifest
 #ifdef MOZ_ANDROID_GCM
 @BINPATH@/components/Push.manifest
 #endif
 @BINPATH@/components/BrowserElementParent.manifest
 @BINPATH@/components/BrowserElementParent.js
 @BINPATH@/components/toolkitsearch.manifest
 
 @BINPATH@/components/extensions.manifest