Bug 1407366 - Part 1: Rename the LanguagePrompt.jsm to RFPHelper.jsm and changing the place of doing uninitialization. r=johannh draft
authorTom Ritter <tom@mozilla.com>
Wed, 24 Apr 2019 09:13:27 -0500
changeset 1965449 744a475c948ee8c987d43a6348deca5e9a4a5a61
parent 1965448 7a59a1df616a3a6c3e4fad25a38dd0dfa087bccd
child 1965450 feeb219584667f53e2c6cd2ddcfcaa89fb6ee243
child 1980227 d929994f46ebb041a623d98aecdeac98266db6c9
push id352464
push usertritter@mozilla.com
push dateWed, 24 Apr 2019 15:45:15 +0000
treeherdertry@93908d5b6e9a [default view] [failures only]
reviewersjohannh
bugs1407366
milestone60.6.2
Bug 1407366 - Part 1: Rename the LanguagePrompt.jsm to RFPHelper.jsm and changing the place of doing uninitialization. r=johannh This patch changes the name of LanguagePrompt.jsm to RFPHelper.jsm. The RFPHelper is going to not only be responsible for the language
browser/base/content/browser.js
browser/components/nsBrowserGlue.js
toolkit/components/resistfingerprinting/LanguagePrompt.jsm
toolkit/components/resistfingerprinting/RFPHelper.jsm
toolkit/components/resistfingerprinting/moz.build
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -24,17 +24,16 @@ XPCOMUtils.defineLazyModuleGetters(this,
   ContentSearch: "resource:///modules/ContentSearch.jsm",
   ContextualIdentityService: "resource://gre/modules/ContextualIdentityService.jsm",
   CustomizableUI: "resource:///modules/CustomizableUI.jsm",
   Deprecated: "resource://gre/modules/Deprecated.jsm",
   DownloadsCommon: "resource:///modules/DownloadsCommon.jsm",
   E10SUtils: "resource://gre/modules/E10SUtils.jsm",
   ExtensionsUI: "resource:///modules/ExtensionsUI.jsm",
   FormValidationHandler: "resource:///modules/FormValidationHandler.jsm",
-  LanguagePrompt: "resource://gre/modules/LanguagePrompt.jsm",
   LightweightThemeConsumer: "resource://gre/modules/LightweightThemeConsumer.jsm",
   LightweightThemeManager: "resource://gre/modules/LightweightThemeManager.jsm",
   Log: "resource://gre/modules/Log.jsm",
   LoginManagerParent: "resource://gre/modules/LoginManagerParent.jsm",
   NetUtil: "resource://gre/modules/NetUtil.jsm",
   NewTabUtils: "resource://gre/modules/NewTabUtils.jsm",
   OpenInTabsUtils: "resource:///modules/OpenInTabsUtils.jsm",
   PageActions: "resource:///modules/PageActions.jsm",
@@ -42,16 +41,17 @@ XPCOMUtils.defineLazyModuleGetters(this,
   PanelMultiView: "resource:///modules/PanelMultiView.jsm",
   PanelView: "resource:///modules/PanelMultiView.jsm",
   PluralForm: "resource://gre/modules/PluralForm.jsm",
   PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
   ProcessHangMonitor: "resource:///modules/ProcessHangMonitor.jsm",
   PromiseUtils: "resource://gre/modules/PromiseUtils.jsm",
   ReaderMode: "resource://gre/modules/ReaderMode.jsm",
   ReaderParent: "resource:///modules/ReaderParent.jsm",
+  RFPHelper: "resource://gre/modules/RFPHelper.jsm",
   RecentWindow: "resource:///modules/RecentWindow.jsm",
   SafeBrowsing: "resource://gre/modules/SafeBrowsing.jsm",
   Sanitizer: "resource:///modules/Sanitizer.jsm",
   SessionStore: "resource:///modules/sessionstore/SessionStore.jsm",
   SchedulePressure: "resource:///modules/SchedulePressure.jsm",
   ShortcutUtils: "resource://gre/modules/ShortcutUtils.jsm",
   SimpleServiceDiscovery: "resource://gre/modules/SimpleServiceDiscovery.jsm",
   SitePermissions: "resource:///modules/SitePermissions.jsm",
@@ -1892,18 +1892,16 @@ var gBrowserInit = {
     CaptivePortalWatcher.uninit();
 
     SidebarUI.uninit();
 
     DownloadsButton.uninit();
 
     gAccessibilityServiceIndicator.uninit();
 
-    LanguagePrompt.uninit();
-
     BrowserSearch.uninit();
 
     // Now either cancel delayedStartup, or clean up the services initialized from
     // it.
     if (this._boundDelayedStartup) {
       this._cancelDelayedStartup();
     } else {
       if (Win7Features)
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -99,17 +99,16 @@ XPCOMUtils.defineLazyModuleGetters(this,
   Feeds: "resource:///modules/Feeds.jsm",
   FileUtils: "resource://gre/modules/FileUtils.jsm",
   FileSource: "resource://gre/modules/L10nRegistry.jsm",
   FormValidationHandler: "resource:///modules/FormValidationHandler.jsm",
   FxAccounts: "resource://gre/modules/FxAccounts.jsm",
   HybridContentTelemetry: "resource://gre/modules/HybridContentTelemetry.jsm",
   Integration: "resource://gre/modules/Integration.jsm",
   L10nRegistry: "resource://gre/modules/L10nRegistry.jsm",
-  LanguagePrompt: "resource://gre/modules/LanguagePrompt.jsm",
   LightweightThemeManager: "resource://gre/modules/LightweightThemeManager.jsm",
   LoginHelper: "resource://gre/modules/LoginHelper.jsm",
   LoginManagerParent: "resource://gre/modules/LoginManagerParent.jsm",
   NetUtil: "resource://gre/modules/NetUtil.jsm",
   NewTabUtils: "resource://gre/modules/NewTabUtils.jsm",
   Normandy: "resource://normandy/Normandy.jsm",
   ObjectUtils: "resource://gre/modules/ObjectUtils.jsm",
   OS: "resource://gre/modules/osfile.jsm",
@@ -121,16 +120,17 @@ XPCOMUtils.defineLazyModuleGetters(this,
   PlacesBackups: "resource://gre/modules/PlacesBackups.jsm",
   PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
   PluralForm: "resource://gre/modules/PluralForm.jsm",
   PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
   ProcessHangMonitor: "resource:///modules/ProcessHangMonitor.jsm",
   ReaderParent: "resource:///modules/ReaderParent.jsm",
   RecentWindow: "resource:///modules/RecentWindow.jsm",
   RemotePrompt: "resource:///modules/RemotePrompt.jsm",
+  RFPHelper: "resource://gre/modules/RFPHelper.jsm",
   SafeBrowsing: "resource://gre/modules/SafeBrowsing.jsm",
   Sanitizer: "resource:///modules/Sanitizer.jsm",
   SessionStore: "resource:///modules/sessionstore/SessionStore.jsm",
   ShellService: "resource:///modules/ShellService.jsm",
   SimpleServiceDiscovery: "resource://gre/modules/SimpleServiceDiscovery.jsm",
   TabCrashHandler: "resource:///modules/ContentCrashHandlers.jsm",
   UIState: "resource://services-sync/UIState.jsm",
   UITour: "resource:///modules/UITour.jsm",
@@ -1047,16 +1047,17 @@ BrowserGlue.prototype = {
     DateTimePickerHelper.uninit();
 
     // Browser errors are only collected on Nightly
     if (AppConstants.NIGHTLY_BUILD && AppConstants.MOZ_DATA_REPORTING) {
       this.browserErrorReporter.uninit();
     }
 
     Normandy.uninit();
+    RFPHelper.uninit();
   },
 
   // All initial windows have opened.
   _onWindowsRestored: function BG__onWindowsRestored() {
     if (this._windowsWereRestored) {
       return;
     }
     this._windowsWereRestored = true;
@@ -1200,17 +1201,17 @@ BrowserGlue.prototype = {
 
     if (AppConstants.platform == "win") {
       Services.tm.idleDispatchToMainThread(() => {
         JawsScreenReaderVersionCheck.onWindowsRestored();
       });
     }
 
     Services.tm.idleDispatchToMainThread(() => {
-      LanguagePrompt.init();
+      RFPHelper.init();
     });
 
     Services.tm.idleDispatchToMainThread(() => {
       Services.blocklist.loadBlocklistAsync();
     });
   },
 
   /**
old mode 100644
new mode 100755
rename from toolkit/components/resistfingerprinting/LanguagePrompt.jsm
rename to toolkit/components/resistfingerprinting/RFPHelper.jsm
--- a/toolkit/components/resistfingerprinting/LanguagePrompt.jsm
+++ b/toolkit/components/resistfingerprinting/RFPHelper.jsm
@@ -1,24 +1,24 @@
 // -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
 /* 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";
 
-var EXPORTED_SYMBOLS = ["LanguagePrompt"];
+var EXPORTED_SYMBOLS = ["RFPHelper"];
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 const kPrefResistFingerprinting = "privacy.resistFingerprinting";
 const kPrefSpoofEnglish = "privacy.spoof_english";
 const kTopicHttpOnModifyRequest = "http-on-modify-request";
 
-class _LanguagePrompt {
+class _RFPHelper {
   constructor() {
     this._initialized = false;
   }
 
   init() {
     if (this._initialized) {
       return;
     }
@@ -195,9 +195,9 @@ class _LanguagePrompt {
       httpChannel = channel.QueryInterface(Ci.nsIHttpChannel);
     } catch (e) {
       return null;
     }
     return httpChannel.getRequestHeader("Accept-Language");
   }
 }
 
-let LanguagePrompt = new _LanguagePrompt();
+let RFPHelper = new _RFPHelper();
--- a/toolkit/components/resistfingerprinting/moz.build
+++ b/toolkit/components/resistfingerprinting/moz.build
@@ -16,10 +16,10 @@ FINAL_LIBRARY = 'xul'
 EXPORTS += [
     'nsRFPService.h'
 ]
 EXPORTS.mozilla += [
     'RelativeTimeline.h',
 ]
 
 EXTRA_JS_MODULES += [
-    'LanguagePrompt.jsm',
+    'RFPHelper.jsm',
 ]