Bug 1524688: Part 28 - Convert SecurityReporter to static registration. r=johannh
authorKris Maglione <maglione.k@gmail.com>
Fri, 01 Mar 2019 12:55:54 -0800
changeset 519990 280ea49c019b9bb8c19d265056e49a6ac08555d1
parent 519989 c27077a06c6dc7d542034a36434f1041e3dcab31
child 519991 f8fb6e47bb24093cb635cb475d1ff3df2d8697b0
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
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 28 - Convert SecurityReporter to static registration. r=johannh
browser/installer/package-manifest.in
mobile/android/installer/package-manifest.in
toolkit/components/securityreporter/SecurityReporter.js
toolkit/components/securityreporter/SecurityReporter.jsm
toolkit/components/securityreporter/SecurityReporter.manifest
toolkit/components/securityreporter/components.conf
toolkit/components/securityreporter/moz.build
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -210,20 +210,16 @@
 @RESPATH@/browser/components/extensions-browser.manifest
 
 ; Modules
 @RESPATH@/browser/modules/*
 @RESPATH@/modules/*
 @RESPATH@/browser/actors/*
 @RESPATH@/actors/*
 
-; Security Reports
-@RESPATH@/components/SecurityReporter.manifest
-@RESPATH@/components/SecurityReporter.js
-
 ; ANGLE GLES-on-D3D rendering library
 #ifdef MOZ_ANGLE_RENDERER
 @BINPATH@/libEGL.dll
 @BINPATH@/libGLESv2.dll
 
 #ifdef MOZ_D3DCOMPILER_VISTA_DLL
 @BINPATH@/@MOZ_D3DCOMPILER_VISTA_DLL@
 #endif
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -137,20 +137,16 @@
 @BINPATH@/components/TestInterfaceJS.manifest
 @BINPATH@/components/TestInterfaceJSMaplike.js
 #endif
 
 ; Modules
 @BINPATH@/modules/*
 @BINPATH@/actors/*
 
-; Security Reports
-@BINPATH@/components/SecurityReporter.manifest
-@BINPATH@/components/SecurityReporter.js
-
 ; [Browser Chrome Files]
 @BINPATH@/chrome/toolkit@JAREXT@
 @BINPATH@/chrome/toolkit.manifest
 
 ; [Extensions]
 @BINPATH@/components/extensions-toolkit.manifest
 @BINPATH@/components/extensions-mobile.manifest
 
rename from toolkit/components/securityreporter/SecurityReporter.js
rename to toolkit/components/securityreporter/SecurityReporter.jsm
--- a/toolkit/components/securityreporter/SecurityReporter.js
+++ b/toolkit/components/securityreporter/SecurityReporter.jsm
@@ -26,19 +26,16 @@ function getDERString(cert) {
     derString += String.fromCharCode(derArray[i]);
   }
   return derString;
 }
 
 function SecurityReporter() { }
 
 SecurityReporter.prototype = {
-  classDescription: "Security reporter component",
-  classID:          Components.ID("{8a997c9a-bea1-11e5-a1fa-be6aBc8e7f8b}"),
-  contractID:       "@mozilla.org/securityreporter;1",
   QueryInterface: ChromeUtils.generateQI([Ci.nsISecurityReporter]),
   reportTLSError(transportSecurityInfo, hostname, port) {
     // don't send if there's no transportSecurityInfo (since the report cannot
     // contain anything of interest)
     if (!transportSecurityInfo) {
       return;
     }
 
@@ -99,9 +96,9 @@ SecurityReporter.prototype = {
     }).catch(function(e) {
       // error making request to reportURL
       Services.telemetry.getHistogramById(HISTOGRAM_ID)
           .add(TLS_ERROR_REPORT_TELEMETRY_FAILURE);
     });
   },
 };
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SecurityReporter]);
+var EXPORTED_SYMBOLS = ["SecurityReporter"];
deleted file mode 100644
--- a/toolkit/components/securityreporter/SecurityReporter.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {8a997c9a-bea1-11e5-a1fa-be6aBc8e7f8b} SecurityReporter.js
-contract @mozilla.org/securityreporter;1 {8a997c9a-bea1-11e5-a1fa-be6aBc8e7f8b}
new file mode 100644
--- /dev/null
+++ b/toolkit/components/securityreporter/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': '{8a997c9a-bea1-11e5-a1fa-be6aBc8e7f8b}',
+        'contract_ids': ['@mozilla.org/securityreporter;1'],
+        'jsm': 'resource://gre/modules/SecurityReporter.jsm',
+        'constructor': 'SecurityReporter',
+    },
+]
--- a/toolkit/components/securityreporter/moz.build
+++ b/toolkit/components/securityreporter/moz.build
@@ -8,12 +8,15 @@ with Files('**'):
     BUG_COMPONENT = ('Firefox', 'General')
 
 XPIDL_MODULE = 'toolkit_securityreporter'
 
 XPIDL_SOURCES += [
     'nsISecurityReporter.idl',
 ]
 
-EXTRA_COMPONENTS += [
-    'SecurityReporter.js',
-    'SecurityReporter.manifest',
+EXTRA_JS_MODULES += [
+    'SecurityReporter.jsm',
 ]
+
+XPCOM_MANIFESTS += [
+    'components.conf',
+]