Bug 1524688: Part 54 - Convert ConsoleAPIStorage to static registration. r=baku
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 11:34:41 -0800
changeset 459025 0ad5465eace1f9294f87ae8c705db322d5cfe953
parent 459024 1e75ce91029b4eb030071e9802cd0bdbad59b9cf
child 459026 6c63bc2409729cf175b319cfb7cd95850aa1ab46
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)
reviewersbaku
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 54 - Convert ConsoleAPIStorage to static registration. r=baku Differential Revision: https://phabricator.services.mozilla.com/D18464
browser/installer/package-manifest.in
dom/console/ConsoleAPI.manifest
dom/console/ConsoleAPIStorage.js
dom/console/ConsoleAPIStorage.jsm
dom/console/components.conf
dom/console/moz.build
mobile/android/installer/package-manifest.in
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -155,18 +155,16 @@
 @BINPATH@/Accessible.tlb
 @BINPATH@/AccessibleHandler.dll
 @BINPATH@/AccessibleMarshal.dll
 @BINPATH@/IA2Marshal.dll
 #endif
 #endif
 
 ; JavaScript components
-@RESPATH@/components/ConsoleAPI.manifest
-@RESPATH@/components/ConsoleAPIStorage.js
 @RESPATH@/components/BrowserElementParent.manifest
 @RESPATH@/components/BrowserElementParent.js
 @RESPATH@/browser/components/BrowserComponents.manifest
 @RESPATH@/browser/components/devtools-startup.manifest
 @RESPATH@/browser/components/devtools-startup.js
 @RESPATH@/browser/components/aboutdebugging-registration.js
 @RESPATH@/browser/components/aboutdebugging.manifest
 #ifdef NIGHTLY_BUILD
deleted file mode 100644
--- 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}
rename from dom/console/ConsoleAPIStorage.js
rename to dom/console/ConsoleAPIStorage.jsm
--- a/dom/console/ConsoleAPIStorage.js
+++ b/dom/console/ConsoleAPIStorage.jsm
@@ -1,20 +1,16 @@
 /* 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/. */
 
 "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();
 
 const CONSOLEAPISTORAGE_CID = Components.ID("{96cf7855-dfa9-4c6d-8276-f9705b4890f2}");
 
 /**
  * The ConsoleAPIStorage is meant to cache window.console API calls for later
@@ -137,9 +133,9 @@ ConsoleAPIStorageService.prototype = {
       _consoleStorage.delete(aId);
     } else {
       _consoleStorage.clear();
       Services.obs.notifyObservers(null, "console-storage-reset");
     }
   },
 };
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ConsoleAPIStorageService]);
+var EXPORTED_SYMBOLS = ["ConsoleAPIStorageService"];
new file mode 100644
--- /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',
+    },
+]
--- a/dom/console/moz.build
+++ b/dom/console/moz.build
@@ -29,19 +29,22 @@ EXPORTS.mozilla.dom += [
 
 UNIFIED_SOURCES += [
     'Console.cpp',
     'ConsoleInstance.cpp',
     'ConsoleReportCollector.cpp',
     'ConsoleUtils.cpp',
 ]
 
-EXTRA_COMPONENTS += [
-    'ConsoleAPI.manifest',
-    'ConsoleAPIStorage.js',
+EXTRA_JS_MODULES += [
+    'ConsoleAPIStorage.jsm',
+]
+
+XPCOM_MANIFESTS += [
+    'components.conf',
 ]
 
 LOCAL_INCLUDES += [
     '/docshell/base',
     '/dom/base',
     '/js/xpconnect/src',
 ]
 
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -96,18 +96,16 @@
 @BINPATH@/blocklist.xml
 @BINPATH@/defaults/settings/blocklists/addons.json
 @BINPATH@/defaults/settings/blocklists/certificates.json
 
 ; [Components]
 @BINPATH@/components/components.manifest
 
 ; JavaScript components
-@BINPATH@/components/ConsoleAPI.manifest
-@BINPATH@/components/ConsoleAPIStorage.js
 #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