From 465465bbf96a6a085d13f7291f38daf72c6da696 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 30 Jan 2019 11:34:41 -0800 Subject: [PATCH] Bug 1524688: Part 54 - Convert ConsoleAPIStorage to static registration. r=baku Differential Revision: https://phabricator.services.mozilla.com/D18464 --HG-- rename : dom/console/ConsoleAPIStorage.js => dom/console/ConsoleAPIStorage.jsm extra : source : 0ad5465eace1f9294f87ae8c705db322d5cfe953 --- browser/installer/package-manifest.in | 2 -- dom/console/ConsoleAPI.manifest | 2 -- ...{ConsoleAPIStorage.js => ConsoleAPIStorage.jsm} | 6 +----- dom/console/components.conf | 14 ++++++++++++++ dom/console/moz.build | 9 ++++++--- mobile/android/installer/package-manifest.in | 2 -- 6 files changed, 21 insertions(+), 14 deletions(-) delete mode 100644 dom/console/ConsoleAPI.manifest rename dom/console/{ConsoleAPIStorage.js => ConsoleAPIStorage.jsm} (94%) create mode 100644 dom/console/components.conf diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index 23fe12e578f2..6ca0b1dc76fc 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -160,8 +160,6 @@ #endif ; JavaScript components -@RESPATH@/components/ConsoleAPI.manifest -@RESPATH@/components/ConsoleAPIStorage.js @RESPATH@/components/BrowserElementParent.manifest @RESPATH@/components/BrowserElementParent.js @RESPATH@/browser/components/BrowserComponents.manifest diff --git a/dom/console/ConsoleAPI.manifest b/dom/console/ConsoleAPI.manifest deleted file mode 100644 index 56e0768a729e..000000000000 --- a/dom/console/ConsoleAPI.manifest +++ /dev/null @@ -1,2 +0,0 @@ -component {96cf7855-dfa9-4c6d-8276-f9705b4890f2} ConsoleAPIStorage.js -contract @mozilla.org/consoleAPI-storage;1 {96cf7855-dfa9-4c6d-8276-f9705b4890f2} diff --git a/dom/console/ConsoleAPIStorage.js b/dom/console/ConsoleAPIStorage.jsm similarity index 94% rename from dom/console/ConsoleAPIStorage.js rename to dom/console/ConsoleAPIStorage.jsm index 19cf212ea0d8..db6e9128487b 100644 --- a/dom/console/ConsoleAPIStorage.js +++ b/dom/console/ConsoleAPIStorage.jsm @@ -4,12 +4,8 @@ "use strict"; -const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); -// This constant tells how many messages to process in a single timer execution. -const MESSAGES_IN_INTERVAL = 1500; - const STORAGE_MAX_EVENTS = 1000; var _consoleStorage = new Map(); @@ -142,4 +138,4 @@ ConsoleAPIStorageService.prototype = { }, }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ConsoleAPIStorageService]); +var EXPORTED_SYMBOLS = ["ConsoleAPIStorageService"]; diff --git a/dom/console/components.conf b/dom/console/components.conf new file mode 100644 index 000000000000..864bb7686c8f --- /dev/null +++ b/dom/console/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': '{96cf7855-dfa9-4c6d-8276-f9705b4890f2}', + 'contract_ids': ['@mozilla.org/consoleAPI-storage;1'], + 'jsm': 'resource://gre/modules/ConsoleAPIStorage.jsm', + 'constructor': 'ConsoleAPIStorageService', + }, +] diff --git a/dom/console/moz.build b/dom/console/moz.build index 3dd737737420..31f2c6ad6d92 100644 --- a/dom/console/moz.build +++ b/dom/console/moz.build @@ -34,9 +34,12 @@ UNIFIED_SOURCES += [ 'ConsoleUtils.cpp', ] -EXTRA_COMPONENTS += [ - 'ConsoleAPI.manifest', - 'ConsoleAPIStorage.js', +EXTRA_JS_MODULES += [ + 'ConsoleAPIStorage.jsm', +] + +XPCOM_MANIFESTS += [ + 'components.conf', ] LOCAL_INCLUDES += [ diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in index 260970d58c91..c3da8b363317 100644 --- a/mobile/android/installer/package-manifest.in +++ b/mobile/android/installer/package-manifest.in @@ -101,8 +101,6 @@ @BINPATH@/components/components.manifest ; JavaScript components -@BINPATH@/components/ConsoleAPI.manifest -@BINPATH@/components/ConsoleAPIStorage.js #ifdef MOZ_ANDROID_GCM @BINPATH@/components/Push.manifest #endif