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
--- 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);