Bug 1284240 - Use boolean rather than flag for Sandboxing Telemetry. r?gfritzsche
MozReview-Commit-ID: EsXFAbEyxYs
--- a/security/sandbox/linux/common/SandboxInfo.cpp
+++ b/security/sandbox/linux/common/SandboxInfo.cpp
@@ -254,33 +254,23 @@ SandboxInfo::ThreadingCheck()
flags &= ~(kHasUserNamespaces | kHasPrivilegedUserNamespaces);
sSingleton.mFlags = static_cast<Flags>(flags);
}
/* static */ void
SandboxInfo::SubmitTelemetry()
{
SandboxInfo sandboxInfo = Get();
- if (sandboxInfo.Test(SandboxInfo::kHasSeccompBPF)) {
- Telemetry::Accumulate(Telemetry::SANDBOX_CAPABILITIES_SECCOMP_BPF, true);
- }
- if (sandboxInfo.Test(SandboxInfo::kHasSeccompTSync)) {
- Telemetry::Accumulate(Telemetry::SANDBOX_CAPABILITIES_SECCOMP_TSYNC, true);
- }
- if (sandboxInfo.Test(SandboxInfo::kHasPrivilegedUserNamespaces)) {
- Telemetry::Accumulate(
- Telemetry::SANDBOX_CAPABILITIES_USER_NAMESPACES_PRIVILEGED, true);
- }
- if (sandboxInfo.Test(SandboxInfo::kHasUserNamespaces)) {
- Telemetry::Accumulate(
- Telemetry::SANDBOX_CAPABILITIES_USER_NAMESPACES, true);
- }
- if (sandboxInfo.Test(SandboxInfo::kEnabledForContent)) {
- Telemetry::Accumulate(
- Telemetry::SANDBOX_CAPABILITIES_ENABLED_CONTENT, true);
- }
- if (sandboxInfo.Test(SandboxInfo::kEnabledForMedia)) {
- Telemetry::Accumulate(
- Telemetry::SANDBOX_CAPABILITIES_ENABLED_MEDIA, true);
- }
+ Telemetry::Accumulate(Telemetry::SANDBOX_HAS_SECCOMP_BPF,
+ sandboxInfo.Test(SandboxInfo::kHasSeccompBPF));
+ Telemetry::Accumulate(Telemetry::SANDBOX_HAS_SECCOMP_TSYNC,
+ sandboxInfo.Test(SandboxInfo::kHasSeccompTSync));
+ Telemetry::Accumulate(Telemetry::SANDBOX_HAS_USER_NAMESPACES_PRIVILEGED,
+ sandboxInfo.Test(SandboxInfo::kHasPrivilegedUserNamespaces));
+ Telemetry::Accumulate(Telemetry::SANDBOX_HAS_USER_NAMESPACES,
+ sandboxInfo.Test(SandboxInfo::kHasUserNamespaces));
+ Telemetry::Accumulate(Telemetry::SANDBOX_CONTENT_ENABLED,
+ sandboxInfo.Test(SandboxInfo::kEnabledForContent));
+ Telemetry::Accumulate(Telemetry::SANDBOX_MEDIA_ENABLED,
+ sandboxInfo.Test(SandboxInfo::kEnabledForMedia));
}
} // namespace mozilla
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -9815,61 +9815,61 @@
},
"SANDBOX_BROKER_INITIALIZED": {
"alert_emails": ["bowen@mozilla.com"],
"bug_numbers": [1256992],
"expires_in_version": "55",
"kind": "boolean",
"description": "Result of call to SandboxBroker::Initialize"
},
- "SANDBOX_CAPABILITIES_SECCOMP_BPF": {
+ "SANDBOX_HAS_SECCOMP_BPF": {
"alert_emails": ["gcp@mozilla.com"],
"bug_numbers": [1098428],
"expires_in_version": "55",
- "kind": "flag",
+ "kind": "boolean",
"cpp_guard": "XP_LINUX",
"description": "Whether the system has seccomp-bpf capability"
},
- "SANDBOX_CAPABILITIES_SECCOMP_TSYNC": {
+ "SANDBOX_HAS_SECCOMP_TSYNC": {
"alert_emails": ["gcp@mozilla.com"],
"bug_numbers": [1098428],
"expires_in_version": "55",
- "kind": "flag",
+ "kind": "boolean",
"cpp_guard": "XP_LINUX",
"description": "Whether the system has seccomp-bpf thread-sync capability"
},
- "SANDBOX_CAPABILITIES_USER_NAMESPACES": {
+ "SANDBOX_HAS_USER_NAMESPACES": {
"alert_emails": ["gcp@mozilla.com"],
"bug_numbers": [1098428],
"expires_in_version": "55",
- "kind": "flag",
+ "kind": "boolean",
"cpp_guard": "XP_LINUX",
"description": "Whether our process succedeed in creating a user namespace"
},
- "SANDBOX_CAPABILITIES_USER_NAMESPACES_PRIVILEGED": {
+ "SANDBOX_HAS_USER_NAMESPACES_PRIVILEGED": {
"alert_emails": ["gcp@mozilla.com"],
"bug_numbers": [1098428],
"expires_in_version": "55",
- "kind": "flag",
+ "kind": "boolean",
"cpp_guard": "XP_LINUX",
"description": "Whether the system has the capability to create privileged user namespaces"
},
- "SANDBOX_CAPABILITIES_ENABLED_MEDIA": {
+ "SANDBOX_MEDIA_ENABLED": {
"alert_emails": ["gcp@mozilla.com"],
"bug_numbers": [1098428],
"expires_in_version": "55",
- "kind": "flag",
+ "kind": "boolean",
"cpp_guard": "XP_LINUX",
"description": "Whether the sandbox is enabled for media/GMP plugins"
},
- "SANDBOX_CAPABILITIES_ENABLED_CONTENT": {
+ "SANDBOX_CONTENT_ENABLED": {
"alert_emails": ["gcp@mozilla.com"],
"bug_numbers": [1098428],
"expires_in_version": "55",
- "kind": "flag",
+ "kind": "boolean",
"cpp_guard": "XP_LINUX",
"description": "Whether the sandbox is enabled for the content process"
},
"SYNC_WORKER_OPERATION": {
"alert_emails": ["amarchesini@mozilla.com", "khuey@mozilla.com" ],
"bug_numbers": [1267904],
"expires_in_version": "never",
"kind": "exponential",