mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-21 11:40:34 -10:00
Bug 959356 - Report isWow64 in Firefox Health Report; r=bsmedberg
Previously, we weren't measuring whether the machine was 64-bit properly. This change allows us to report actual CPU architecture (at least on Windows). In the future, we may wish to properly report actual CPU architecture on all operating systems.
This commit is contained in:
1 parent
778f88226f
commit
1888338a5f
3 files changed
+32
-7
No files matched your search
@@ -1235,6 +1235,20 @@ org.mozilla.sysinfo.sysinfo
|
||||
This measurement contains basic information about the system the application
|
||||
is running on.
|
||||
|
||||
Version 2
|
||||
^^^^^^^^^
|
||||
|
||||
This version debuted with Firefox 29 on desktop.
|
||||
|
||||
A single property was introduced.
|
||||
|
||||
isWow64
|
||||
If present, this property indicates whether the machine supports WoW64.
|
||||
This property can be used to identify whether the host machine is 64-bit.
|
||||
|
||||
This property is only present on Windows machines. It is the preferred way
|
||||
to identify 32- vs 64-bit support in that environment.
|
||||
|
||||
Version 1
|
||||
^^^^^^^^^
|
||||
|
||||
@@ -1255,7 +1269,8 @@ name
|
||||
version
|
||||
OS version.
|
||||
architecture
|
||||
OS architecture.
|
||||
OS architecture that the application is built for. This is not the
|
||||
actual system architecture.
|
||||
|
||||
Example
|
||||
^^^^^^^
|
||||
|
||||
@@ -50,6 +50,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "PlacesDBUtils",
|
||||
"resource://gre/modules/PlacesDBUtils.jsm");
|
||||
|
||||
|
||||
const LAST_NUMERIC_FIELD = {type: Metrics.Storage.FIELD_LAST_NUMERIC};
|
||||
const LAST_TEXT_FIELD = {type: Metrics.Storage.FIELD_LAST_TEXT};
|
||||
const DAILY_DISCRETE_NUMERIC_FIELD = {type: Metrics.Storage.FIELD_DAILY_DISCRETE_NUMERIC};
|
||||
const DAILY_LAST_NUMERIC_FIELD = {type: Metrics.Storage.FIELD_DAILY_LAST_NUMERIC};
|
||||
@@ -415,7 +416,7 @@ SysInfoMeasurement.prototype = Object.freeze({
|
||||
__proto__: Metrics.Measurement.prototype,
|
||||
|
||||
name: "sysinfo",
|
||||
version: 1,
|
||||
version: 2,
|
||||
|
||||
fields: {
|
||||
cpuCount: {type: Metrics.Storage.FIELD_LAST_NUMERIC},
|
||||
@@ -426,6 +427,7 @@ SysInfoMeasurement.prototype = Object.freeze({
|
||||
name: LAST_TEXT_FIELD,
|
||||
version: LAST_TEXT_FIELD,
|
||||
architecture: LAST_TEXT_FIELD,
|
||||
isWow64: LAST_NUMERIC_FIELD,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -452,6 +454,7 @@ SysInfoProvider.prototype = Object.freeze({
|
||||
name: "name",
|
||||
version: "version",
|
||||
arch: "architecture",
|
||||
isWOW64: "isWow64",
|
||||
},
|
||||
|
||||
collectConstantData: function () {
|
||||
@@ -485,9 +488,16 @@ SysInfoProvider.prototype = Object.freeze({
|
||||
method = "setLastNumeric";
|
||||
}
|
||||
|
||||
// Round memory to mebibytes.
|
||||
if (k == "memsize") {
|
||||
value = Math.round(value / 1048576);
|
||||
switch (k) {
|
||||
case "memsize":
|
||||
// Round memory to mebibytes.
|
||||
value = Math.round(value / 1048576);
|
||||
break;
|
||||
case "isWow64":
|
||||
// Property is only present on Windows. hasKey() skipping from
|
||||
// above ensures undefined or null doesn't creep in here.
|
||||
value = value ? 1 : 0;
|
||||
break;
|
||||
}
|
||||
|
||||
yield m[method](v, value);
|
||||
|
||||
@@ -27,12 +27,12 @@ add_task(function test_collect_smoketest() {
|
||||
|
||||
yield provider.collectConstantData();
|
||||
|
||||
let m = provider.getMeasurement("sysinfo", 1);
|
||||
let m = provider.getMeasurement("sysinfo", 2);
|
||||
let data = yield storage.getMeasurementValues(m.id);
|
||||
let serializer = m.serializer(m.SERIALIZE_JSON);
|
||||
let d = serializer.singular(data.singular);
|
||||
|
||||
do_check_eq(d._v, 1);
|
||||
do_check_eq(d._v, 2);
|
||||
do_check_true(d.cpuCount > 0);
|
||||
do_check_neq(d.name, null);
|
||||
|
||||
|
||||
Reference in new issue
Block a user