Bug 1421066 - remove getAppIniString from devtools/shared/system.js; r?ochameau draft
authorTom Tromey <tom@tromey.com>
Tue, 28 Nov 2017 09:04:10 -0700
changeset 704355 38f7dc4fcb8343c231e516843d030d2106c563ce
parent 704354 45030c5aa987416ffb6a23be325e65d484c12229
child 742075 bd3406b88cc470fbdd243c7246a5e1f7b99dd7fd
push id91157
push userbmo:ttromey@mozilla.com
push dateTue, 28 Nov 2017 16:08:18 +0000
reviewersochameau
bugs1421066
milestone59.0a1
Bug 1421066 - remove getAppIniString from devtools/shared/system.js; r?ochameau getAppIniString was found to be slow, and the results were never used; so remove it. MozReview-Commit-ID: Lk90vnElC0
devtools/shared/system.js
--- a/devtools/shared/system.js
+++ b/devtools/shared/system.js
@@ -127,19 +127,16 @@ function* getSystemInfo() {
     // Typically, the version of Firefox, for example.
     // It is different than the version of Gecko or the XULRunner platform.
     // On B2G, this is the Gaia version.
     version,
 
     // The application's build ID/date, for example "2004051604".
     appbuildid: appInfo.appBuildID,
 
-    // The application's changeset.
-    changeset: exports.getAppIniString("App", "SourceStamp"),
-
     // The build ID/date of Gecko and the XULRunner platform.
     platformbuildid: appInfo.platformBuildID,
     geckobuildid: appInfo.platformBuildID,
 
     // The version of Gecko or XULRunner platform, for example "1.8.1.19" or
     // "1.9.3pre". In "Firefox 3.7 alpha 1" the application version is "3.7a1pre"
     // while the platform version is "1.9.3pre"
     platformversion: geckoVersion,
@@ -212,38 +209,16 @@ function getProfileLocation() {
     }
 
     return profd.leafName;
   } catch (e) {
     return "";
   }
 }
 
-function getAppIniString(section, key) {
-  let inifile = Services.dirsvc.get("GreD", Ci.nsIFile);
-  inifile.append("application.ini");
-
-  if (!inifile.exists()) {
-    inifile = Services.dirsvc.get("CurProcD", Ci.nsIFile);
-    inifile.append("application.ini");
-  }
-
-  if (!inifile.exists()) {
-    return undefined;
-  }
-
-  let iniParser = Cc["@mozilla.org/xpcom/ini-parser-factory;1"]
-                    .getService(Ci.nsIINIParserFactory).createINIParser(inifile);
-  try {
-    return iniParser.getString(section, key);
-  } catch (e) {
-    return undefined;
-  }
-}
-
 /**
  * Function for fetching screen dimensions and returning
  * an enum for Telemetry.
  */
 function getScreenDimensions() {
   let width = {};
   let height = {};
 
@@ -345,13 +320,12 @@ function getSetting(name) {
     });
   } else {
     deferred.reject(new Error("No settings service"));
   }
   return deferred.promise;
 }
 
 exports.getSystemInfo = Task.async(getSystemInfo);
-exports.getAppIniString = getAppIniString;
 exports.getSetting = getSetting;
 exports.getScreenDimensions = getScreenDimensions;
 exports.getOSCPU = getOSCPU;
 exports.constants = AppConstants;