Bug 1361601 - Remove nsSystemInfo.getProperty("host") r?froydnj draft
authorPatrick McManus <mcmanus@ducksong.com>
Tue, 02 May 2017 16:54:46 -0400
changeset 571627 01b61b04441a1e13065f1b36358362bf09f8b481
parent 571414 bfc7b187005cabbc828ed9f5b61daf139c3cfd90
child 626834 ec1029c3bdf099059de52616d8f1bcb1beb7f3fe
push id56870
push userbmo:mcmanus@ducksong.com
push dateWed, 03 May 2017 02:30:33 +0000
reviewersfroydnj
bugs1361601, 1361495
milestone55.0a1
Bug 1361601 - Remove nsSystemInfo.getProperty("host") r?froydnj See also bug 1361495 - PR_SI_HOSTNAME is implemented in NSPR on Windows as initializing winsock which can be janky. There don't seem to be any users of this property, and it has tracker concerns anyhow - so remove it. MozReview-Commit-ID: S2AwzMUgYk
xpcom/base/nsSystemInfo.cpp
xpcom/tests/unit/test_systemInfo.js
--- a/xpcom/base/nsSystemInfo.cpp
+++ b/xpcom/base/nsSystemInfo.cpp
@@ -347,17 +347,16 @@ nsSystemInfo::Init()
   nsresult rv;
 
   static const struct
   {
     PRSysInfo cmd;
     const char* name;
   } items[] = {
     { PR_SI_SYSNAME, "name" },
-    { PR_SI_HOSTNAME, "host" },
     { PR_SI_ARCHITECTURE, "arch" },
     { PR_SI_RELEASE, "version" }
   };
 
   for (uint32_t i = 0; i < (sizeof(items) / sizeof(items[0])); i++) {
     char buf[SYS_INFO_BUFFER_LENGTH];
     if (PR_GetSystemInfo(items[i].cmd, buf, sizeof(buf)) == PR_SUCCESS) {
       rv = SetPropertyAsACString(NS_ConvertASCIItoUTF16(items[i].name),
--- a/xpcom/tests/unit/test_systemInfo.js
+++ b/xpcom/tests/unit/test_systemInfo.js
@@ -1,14 +1,14 @@
 /* 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/. */
 
 function run_test() {
-  const PROPERTIES = ["name", "host", "arch", "version", "pagesize",
+  const PROPERTIES = ["name", "arch", "version", "pagesize",
                       "pageshift", "memmapalign", "cpucount", "memsize"];
   let sysInfo = Components.classes["@mozilla.org/system-info;1"].
                 getService(Components.interfaces.nsIPropertyBag2);
 
   PROPERTIES.forEach(function(aPropertyName) {
     print("Testing property: " + aPropertyName);
     let value = sysInfo.getProperty(aPropertyName);
     do_check_true(!!value);