Bug 1436425 - Stop importing resetProfile.js when it is unneeded. r=MattN
authorMarco Castelluccio <mcastelluccio@mozilla.com>
Wed, 07 Feb 2018 13:08:55 +0100
changeset 402962 e3cc726cd6206dfd4f89b917c9269af014dafb75
parent 402961 31a6b24710a5976f353e715d995527bfa4c86e8a
child 402963 c4034229cf62b13f2ca721f6dc9eb52847db6215
push id33407
push usercbrindusan@mozilla.com
push dateThu, 08 Feb 2018 19:02:31 +0000
treeherdermozilla-central@c5120bcaf7bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1436425
milestone60.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 1436425 - Stop importing resetProfile.js when it is unneeded. r=MattN
browser/base/content/safeMode.js
browser/base/content/safeMode.xul
toolkit/content/aboutSupport.xhtml
toolkit/content/resetProfile.js
--- a/browser/base/content/safeMode.js
+++ b/browser/base/content/safeMode.js
@@ -1,14 +1,14 @@
 /* -*- 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/. */
 
-/* import-globals-from ../../../toolkit/content/resetProfile.js */
+ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const appStartup = Services.startup;
 
 ChromeUtils.import("resource://gre/modules/ResetProfile.jsm");
 
 var defaultToReset = false;
 
 function restartApp() {
--- a/browser/base/content/safeMode.xul
+++ b/browser/base/content/safeMode.xul
@@ -23,17 +23,16 @@
             buttonlabelaccept="&startSafeMode.label;"
             buttonlabelextra1="&refreshProfile.label;"
             maxwidth="&window.maxWidth;"
             ondialogaccept="return onDefaultButton()"
             ondialogcancel="onCancel();"
             ondialogextra1="return onExtra1()"
             onload="onLoad()">
 
-  <script type="application/javascript" src="chrome://global/content/resetProfile.js"/>
   <script type="application/javascript" src="chrome://browser/content/safeMode.js"/>
 
   <vbox id="autoSafeMode" hidden="true">
     <description>&autoSafeModeDescription3.label;</description>
   </vbox>
 
   <vbox id="safeMode">
     <label>&safeModeDescription3.label;</label>
--- a/toolkit/content/aboutSupport.xhtml
+++ b/toolkit/content/aboutSupport.xhtml
@@ -20,18 +20,16 @@
           href="chrome://branding/content/icon32.png"/>
     <link rel="stylesheet" href="chrome://global/skin/in-content/common.css"
           type="text/css"/>
     <link rel="stylesheet" href="chrome://global/skin/aboutSupport.css"
           type="text/css"/>
 
     <script type="application/javascript"
             src="chrome://global/content/aboutSupport.js"/>
-    <script type="application/javascript"
-            src="chrome://global/content/resetProfile.js"/>
   </head>
 
   <body dir="&locale.dir;">
 
 #ifndef ANDROID
     <div id="action-box">
       <div id="reset-box">
         <h3>&refreshProfile.title;</h3>
--- a/toolkit/content/resetProfile.js
+++ b/toolkit/content/resetProfile.js
@@ -1,20 +1,10 @@
 /* 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";
 
-// NB: this file can be loaded from aboutSupport.xhtml or from the
-// resetProfile.xul dialog, and so Cu may or may not exist already.
-// Proceed with caution:
-if (!("Cu" in window)) {
-  window.Cu = Components.utils;
-}
-
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource://gre/modules/ResetProfile.jsm");
-
 function onResetProfileAccepted() {
   let retVals = window.arguments[0];
   retVals.reset = true;
 }