Bug 1463183 - Remove all instances of isUniversalBinary from nsIMacUtils draft
authorBharat Raghunathan <bharatraghunthan9767@gmail.com>
Thu, 31 May 2018 20:04:23 +0530
changeset 802145 f0dc837b8a7eee67f39eeeee6a00b421e99e53b9
parent 802102 763f30c3421233a45ef9e67a695c5c241a2c8a3a
push id111837
push userbmo:bharatraghunthan9767@gmail.com
push dateThu, 31 May 2018 14:35:33 +0000
bugs1463183
milestone62.0a1
Bug 1463183 - Remove all instances of isUniversalBinary from nsIMacUtils MozReview-Commit-ID: FZfVrYtEo13
testing/marionette/puppeteer/firefox/firefox_puppeteer/api/software_update.py
toolkit/components/telemetry/TelemetryEnvironment.jsm
toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
toolkit/components/urlformatter/nsURLFormatter.js
toolkit/components/urlformatter/tests/unit/test_urlformatter.js
toolkit/modules/UpdateUtils.jsm
toolkit/modules/tests/xpcshell/test_UpdateUtils_url.js
toolkit/mozapps/extensions/Blocklist.jsm
toolkit/mozapps/extensions/test/xpcshell/test_blocklist_url_parameters.js
xpcom/base/nsIMacUtils.idl
--- a/testing/marionette/puppeteer/firefox/firefox_puppeteer/api/software_update.py
+++ b/testing/marionette/puppeteer/firefox/firefox_puppeteer/api/software_update.py
@@ -184,19 +184,16 @@ class SoftwareUpdate(BaseLib):
 
         :returns: ABI version
         """
         abi = self.app_info.XPCOMABI
         if mozinfo.isMac:
             abi += self.marionette.execute_script("""
               let macutils = Components.classes['@mozilla.org/xpcom/mac-utils;1']
                              .getService(Components.interfaces.nsIMacUtils);
-              if (macutils.isUniversalBinary) {
-                return '-u-' + macutils.architecturesInBinary;
-              }
               return '';
             """)
 
         return abi
 
     @property
     def active_update(self):
         """ Holds a reference to an :class:`ActiveUpdate` object."""
--- a/toolkit/components/telemetry/TelemetryEnvironment.jsm
+++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm
@@ -1351,17 +1351,17 @@ EnvironmentCache.prototype = {
       platformVersion: Services.appinfo.platformVersion || null,
       xpcomAbi: Services.appinfo.XPCOMABI,
       updaterAvailable: AppConstants.MOZ_UPDATER,
     };
 
     // Add |architecturesInBinary| only for Mac Universal builds.
     if ("@mozilla.org/xpcom/mac-utils;1" in Cc) {
       let macUtils = Cc["@mozilla.org/xpcom/mac-utils;1"].getService(Ci.nsIMacUtils);
-      if (macUtils && macUtils.isUniversalBinary) {
+      if (macUtils) {
         buildData.architecturesInBinary = macUtils.architecturesInBinary;
       }
     }
 
     return buildData;
   },
 
   /**
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
@@ -398,17 +398,17 @@ function checkBuildSection(data) {
     Assert.equal(data.build[f], expectedInfo[f], f + " must have the correct value.");
   }
 
   // Make sure architecture is in the environment.
   Assert.ok(checkString(data.build.architecture));
 
   if (gIsMac) {
     let macUtils = Cc["@mozilla.org/xpcom/mac-utils;1"].getService(Ci.nsIMacUtils);
-    if (macUtils && macUtils.isUniversalBinary) {
+    if (macUtils) {
       Assert.ok(checkString(data.build.architecturesInBinary));
     }
   }
 
   Assert.equal(data.build.updaterAvailable, AppConstants.MOZ_UPDATER,
                "build.updaterAvailable must equal AppConstants.MOZ_UPDATER");
 }
 
--- a/toolkit/components/urlformatter/nsURLFormatter.js
+++ b/toolkit/components/urlformatter/nsURLFormatter.js
@@ -29,17 +29,17 @@ function nsURLFormatterService() {
     try {
       ABI = Services.appinfo.XPCOMABI;
 
       if ("@mozilla.org/xpcom/mac-utils;1" in Cc) {
         // Mac universal build should report a different ABI than either macppc
         // or mactel.
         let macutils = Cc["@mozilla.org/xpcom/mac-utils;1"]
                          .getService(Ci.nsIMacUtils);
-        if (macutils && macutils.isUniversalBinary) {
+        if (macutils) {
           ABI = "Universal-gcc3";
         }
       }
     } catch (e) {}
 
     return ABI;
   });
 
--- a/toolkit/components/urlformatter/tests/unit/test_urlformatter.js
+++ b/toolkit/components/urlformatter/tests/unit/test_urlformatter.js
@@ -13,17 +13,17 @@ function run_test() {
     OSVersion += " (" + Services.sysinfo.getProperty("secondaryLibrary") + ")";
   } catch (e) {}
   OSVersion = encodeURIComponent(OSVersion);
   var macutils = null;
   try {
     macutils = Cc["@mozilla.org/xpcom/mac-utils;1"].
                getService(Ci.nsIMacUtils);
   } catch (e) {}
-  var abi = macutils && macutils.isUniversalBinary ? "Universal-gcc3" : Services.appinfo.XPCOMABI;
+  var abi = macutils && Services.appinfo.XPCOMABI;
 
   let defaults = Services.prefs.getDefaultBranch(null);
   let channel = defaults.getCharPref("app.update.channel", "default");
 
   // Set distribution values.
   defaults.setCharPref("distribution.id", "bacon");
   defaults.setCharPref("distribution.version", "1.0");
 
--- a/toolkit/modules/UpdateUtils.jsm
+++ b/toolkit/modules/UpdateUtils.jsm
@@ -246,20 +246,16 @@ XPCOMUtils.defineLazyGetter(UpdateUtils,
     Cu.reportError("XPCOM ABI unknown");
   }
 
   if (AppConstants.platform == "macosx") {
     // Mac universal build should report a different ABI than either macppc
     // or mactel.
     let macutils = Cc["@mozilla.org/xpcom/mac-utils;1"].
                    getService(Ci.nsIMacUtils);
-
-    if (macutils.isUniversalBinary) {
-      abi += "-u-" + macutils.architecturesInBinary;
-    }
   } else if (AppConstants.platform == "win") {
     // Windows build should report the CPU architecture that it's running on.
     abi += "-" + gWinCPUArch;
   }
 
   if (AppConstants.ASAN) {
     // Allow ASan builds to receive their own updates
     abi += "-asan";
--- a/toolkit/modules/tests/xpcshell/test_UpdateUtils_url.js
+++ b/toolkit/modules/tests/xpcshell/test_UpdateUtils_url.js
@@ -202,20 +202,16 @@ add_task(async function test_build_targe
   }
 
   if (AppConstants.platform == "macosx") {
     // Mac universal build should report a different ABI than either macppc
     // or mactel. This is necessary since nsUpdateService.js will set the ABI to
     // Universal-gcc3 for Mac universal builds.
     let macutils = Cc["@mozilla.org/xpcom/mac-utils;1"].
                    getService(Ci.nsIMacUtils);
-
-    if (macutils.isUniversalBinary) {
-      abi += "-u-" + macutils.architecturesInBinary;
-    }
   } else if (AppConstants.platform == "win") {
     // Windows build should report the CPU architecture that it's running on.
     abi += "-" + getProcArchitecture();
   }
 
   if (AppConstants.ASAN) {
     // Allow ASan builds to receive their own updates
     abi += "-asan";
--- a/toolkit/mozapps/extensions/Blocklist.jsm
+++ b/toolkit/mozapps/extensions/Blocklist.jsm
@@ -130,19 +130,16 @@ XPCOMUtils.defineLazyGetter(this, "gABI"
     LOG("BlockList Global gABI: XPCOM ABI unknown.");
   }
 
   if (AppConstants.platform == "macosx") {
     // Mac universal build should report a different ABI than either macppc
     // or mactel.
     let macutils = Cc["@mozilla.org/xpcom/mac-utils;1"].
                    getService(Ci.nsIMacUtils);
-
-    if (macutils.isUniversalBinary)
-      abi += "-u-" + macutils.architecturesInBinary;
   }
   return abi;
 });
 
 XPCOMUtils.defineLazyGetter(this, "gOSVersion", function() {
   let osVersion;
   try {
     osVersion = Services.sysinfo.getProperty("name") + " " + Services.sysinfo.getProperty("version");
--- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_url_parameters.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_url_parameters.js
@@ -42,19 +42,16 @@ add_task(async function test_blocklist_d
 
 add_task(async function test_blocklist_disabled() {
   var ABI = "noarch-spidermonkey";
   // the blacklist service special-cases ABI for Universal binaries,
   // so do the same here.
   const CONTRACT = "@mozilla.org/xpcom/mac-utils;1";
   if (CONTRACT in Cc) {
     let macutils = Cc[CONTRACT].getService(Ci.nsIMacUtils);
-    if (macutils.isUniversalBinary) {
-      ABI += "-u-" + macutils.architecturesInBinary;
-    }
   }
 
   let osVersion;
   try {
     osVersion = Services.sysinfo.getProperty("name") + " " + Services.sysinfo.getProperty("version");
     if (osVersion) {
       osVersion += " (" + Services.sysinfo.getProperty("secondaryLibrary") + ")";
     }
--- a/xpcom/base/nsIMacUtils.idl
+++ b/xpcom/base/nsIMacUtils.idl
@@ -8,22 +8,16 @@
 /**
  * nsIMacUtils: Generic globally-available Mac-specific utilities.
  */
 
 [scriptable, uuid(5E9072D7-FF95-455E-9466-8AF9841A72EC)]
 interface nsIMacUtils : nsISupports
 {
   /**
-   * True when the main executable is a fat file supporting at least
-   * ppc and x86 (universal binary).
-   */
-  readonly attribute boolean isUniversalBinary;
-
-  /**
    * Returns a string containing a list of architectures delimited
    * by "-". Architecture sets are always in the same order:
    * ppc > i386 > ppc64 > x86_64 > (future additions)
    */
   readonly attribute AString architecturesInBinary;
 
   /**
    * True when running under binary translation (Rosetta).