Bug 1594656 - Don't display seccomp-bpf info on non-Linux. r=jld,froydnj
authorGian-Carlo Pascutto <gcp@mozilla.com>
Fri, 15 Nov 2019 09:34:36 +0000
changeset 502125 f6bcd354c056b2a8cabae55a656fb0f38eb01664
parent 502124 94f7a68264785b8866adf35061a3c19804ca2ab2
child 502126 1e7ffa42be6a3726646208e2bcc044867432bbc1
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjld, froydnj
bugs1594656
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1594656 - Don't display seccomp-bpf info on non-Linux. r=jld,froydnj Differential Revision: https://phabricator.services.mozilla.com/D53034
toolkit/modules/AppConstants.jsm
toolkit/modules/Troubleshoot.jsm
--- a/toolkit/modules/AppConstants.jsm
+++ b/toolkit/modules/AppConstants.jsm
@@ -146,33 +146,50 @@ this.AppConstants = Object.freeze({
 
   XP_UNIX:
 #ifdef XP_UNIX
   true,
 #else
   false,
 #endif
 
-# NOTE! XP_LINUX has to go after MOZ_WIDGET_ANDROID otherwise Android
-# builds will be misidentified as linux.
+// NOTE! XP_LINUX has to go after MOZ_WIDGET_ANDROID otherwise Android
+// builds will be misidentified as linux.
   platform:
 #ifdef MOZ_WIDGET_GTK
   "linux",
 #elif XP_WIN
   "win",
 #elif XP_MACOSX
   "macosx",
 #elif MOZ_WIDGET_ANDROID
   "android",
 #elif XP_LINUX
   "linux",
 #else
   "other",
 #endif
 
+// Most of our frontend code assumes that any desktop Unix platform
+// is "linux". Add the distinction for code that needs it.
+  unixstyle:
+#ifdef XP_LINUX
+    "linux",
+#elif XP_OPENBSD
+    "openbsd",
+#elif XP_NETBSD
+    "netbsd",
+#elif XP_FREEBSD
+    "freebsd",
+#elif XP_SOLARIS
+    "solaris",
+#else
+    "other",
+#endif
+
   isPlatformAndVersionAtLeast(platform, version) {
     let platformVersion = Services.sysinfo.getProperty("version");
     return platform == this.platform &&
            Services.vc.compare(platformVersion, version) >= 0;
   },
 
   isPlatformAndVersionAtMost(platform, version) {
     let platformVersion = Services.sysinfo.getProperty("version");
--- a/toolkit/modules/Troubleshoot.jsm
+++ b/toolkit/modules/Troubleshoot.jsm
@@ -769,17 +769,17 @@ if (AppConstants.MOZ_CRASHREPORTER) {
     let data = { submitted: reportsSubmitted, pending: reportsPendingCount };
     done(data);
   };
 }
 
 if (AppConstants.MOZ_SANDBOX) {
   dataProviders.sandbox = function sandbox(done) {
     let data = {};
-    if (AppConstants.platform == "linux") {
+    if (AppConstants.unixstyle == "linux") {
       const keys = [
         "hasSeccompBPF",
         "hasSeccompTSync",
         "hasPrivilegedUserNamespaces",
         "hasUserNamespaces",
         "canSandboxContent",
         "canSandboxMedia",
       ];