Bug 1544875 - Inline subscripts/Globals.jsm into FirefoxMonitor.jsm. r=johannh
☠☠ backed out by e639999f1f28 ☠ ☠
authorNihanth Subramanya <nhnt11@gmail.com>
Thu, 18 Apr 2019 14:41:59 +0000
changeset 470470 bb36364808d5854026b816428a81b08c5924e2ef
parent 470469 3b274cabedb6120549dd2afefbcaa4833ccb1311
child 470471 06b93c66c6e0b3d948e1b225757596a3270d0e51
push id35906
push useraciure@mozilla.com
push dateTue, 23 Apr 2019 22:14:56 +0000
treeherdermozilla-central@0ce3633f8b80 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1544875
milestone68.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 1544875 - Inline subscripts/Globals.jsm into FirefoxMonitor.jsm. r=johannh Differential Revision: https://phabricator.services.mozilla.com/D27797
browser/extensions/fxmonitor/moz.build
browser/extensions/fxmonitor/privileged/FirefoxMonitor.jsm
browser/extensions/fxmonitor/privileged/subscripts/Globals.jsm
--- a/browser/extensions/fxmonitor/moz.build
+++ b/browser/extensions/fxmonitor/moz.build
@@ -21,14 +21,10 @@ FINAL_TARGET_FILES.features['fxmonitor@m
 
 FINAL_TARGET_FILES.features['fxmonitor@mozilla.org']['privileged'] += [
   'privileged/api.js',
   'privileged/FirefoxMonitor.css',
   'privileged/FirefoxMonitor.jsm',
   'privileged/schema.json'
 ]
 
-FINAL_TARGET_FILES.features['fxmonitor@mozilla.org']['privileged']['subscripts'] += [
-  'privileged/subscripts/Globals.jsm'
-]
-
 with Files('**'):
   BUG_COMPONENT = ('Firefox', 'Firefox Monitor')
--- a/browser/extensions/fxmonitor/privileged/FirefoxMonitor.jsm
+++ b/browser/extensions/fxmonitor/privileged/FirefoxMonitor.jsm
@@ -1,14 +1,25 @@
 /* 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/. */
 
 /* globals Services, XPCOMUtils */
 
+ChromeUtils.defineModuleGetter(this, "EveryWindow",
+                               "resource:///modules/EveryWindow.jsm");
+ChromeUtils.defineModuleGetter(this, "PluralForm",
+                               "resource://gre/modules/PluralForm.jsm");
+ChromeUtils.defineModuleGetter(this, "Preferences",
+                               "resource://gre/modules/Preferences.jsm");
+ChromeUtils.defineModuleGetter(this, "RemoteSettings",
+                               "resource://services-settings/remote-settings.js");
+
+const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
+
 this.FirefoxMonitor = {
   // Map of breached site host -> breach metadata.
   domainMap: new Map(),
 
   // Set of hosts for which the user has already been shown,
   // and interacted with, the popup.
   warnedHostsSet: new Set(),
 
@@ -93,21 +104,16 @@ this.FirefoxMonitor = {
   _delayedInited: false,
   async delayedInit() {
     if (this._delayedInited) {
       return;
     }
 
     this._delayedInited = true;
 
-    /* globals EveryWindow, Preferences, RemoteSettings, fetch, btoa, XUL_NS */
-    Services.scriptloader.loadSubScript(
-      this.getURL("privileged/subscripts/Globals.jsm"));
-
-
     // Expire our telemetry on November 1, at which time
     // we should redo data-review.
     let telemetryExpiryDate = new Date(2019, 10, 1); // Month is zero-index
     let today = new Date();
     let expired = today.getTime() > telemetryExpiryDate.getTime();
 
     Services.telemetry.registerEvents("fxmonitor", {
       "interaction": {
@@ -403,18 +409,16 @@ this.FirefoxMonitor = {
     );
 
     Services.telemetry.recordEvent("fxmonitor", "interaction", "doorhanger_shown");
 
     this.notificationsByWindow.get(win).add(n);
   },
 };
 
-/* globals PluralForm */
-
 function PanelUI(doc) {
   this.site = null;
   this.doc = doc;
 
   let box = doc.createElementNS(XUL_NS, "vbox");
 
   let elt = doc.createElementNS(XUL_NS, "description");
   elt.textContent = this.getString("fxmonitor.popupHeader");
deleted file mode 100644
--- a/browser/extensions/fxmonitor/privileged/subscripts/Globals.jsm
+++ /dev/null
@@ -1,18 +0,0 @@
-/* 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/. */
-
-/* eslint-disable no-unused-vars */
-
-ChromeUtils.defineModuleGetter(this, "Preferences",
-                               "resource://gre/modules/Preferences.jsm");
-ChromeUtils.defineModuleGetter(this, "PluralForm",
-                               "resource://gre/modules/PluralForm.jsm");
-ChromeUtils.defineModuleGetter(this, "RemoteSettings",
-                               "resource://services-settings/remote-settings.js");
-ChromeUtils.defineModuleGetter(this, "EveryWindow",
-                               "resource:///modules/EveryWindow.jsm");
-const {setTimeout, clearTimeout} = ChromeUtils.import("resource://gre/modules/Timer.jsm", {});
-Cu.importGlobalProperties(["fetch", "btoa"]);
-
-const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";