From 97cfe92b81515b51cc364fe9f6277791041ebe54 Mon Sep 17 00:00:00 2001 From: Sam Foster Date: Tue, 28 Nov 2017 12:14:02 -0800 Subject: [PATCH] Bug 1416044 - Add telemetry probe for if userChrome.css is loaded. r=francois,jwatt * New USER_CHROME_CSS_LOADED histogram * Just log a boolean to reflect if the userChrome.css was successfully loaded at profile initialization, in the parent process. MozReview-Commit-ID: 8ffSNUot43I --HG-- extra : rebase_source : 11f43e832449952c83cdb104c61c9c33c1aaa123 --- layout/style/nsLayoutStylesheetCache.cpp | 7 +++++++ toolkit/components/telemetry/Histograms.json | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/layout/style/nsLayoutStylesheetCache.cpp b/layout/style/nsLayoutStylesheetCache.cpp index 5279a5e5c4e3..97bfbba9ea91 100644 --- a/layout/style/nsLayoutStylesheetCache.cpp +++ b/layout/style/nsLayoutStylesheetCache.cpp @@ -13,6 +13,7 @@ #include "mozilla/Preferences.h" #include "mozilla/StyleSheet.h" #include "mozilla/StyleSheetInlines.h" +#include "mozilla/Telemetry.h" #include "mozilla/css/Loader.h" #include "mozilla/dom/SRIMetadata.h" #include "MainThreadUtils.h" @@ -441,6 +442,12 @@ nsLayoutStylesheetCache::InitFromProfile() LoadSheetFile(contentFile, &mUserContentSheet, eUserSheetFeatures, eLogToConsole); LoadSheetFile(chromeFile, &mUserChromeSheet, eUserSheetFeatures, eLogToConsole); + + if (XRE_IsParentProcess()) { + // We're interested specifically in potential chrome customizations, + // so we only need data points from the parent process + Telemetry::Accumulate(Telemetry::USER_CHROME_CSS_LOADED, mUserChromeSheet != nullptr); + } } void diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index dbcbbb111b4d..3c038152dcb0 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -13844,6 +13844,15 @@ "n_values": 64, "description": "URL CLassifier-related (aka Safe Browsing) UI events. See nsIUrlClassifierUITelemetry.idl for the specific values." }, + "USER_CHROME_CSS_LOADED": { + "record_in_processes": ["main"], + "bug_numbers": [1416044], + "expires_in_version": "62", + "alert_emails": ["sfoster@mozilla.com"], + "kind": "boolean", + "releaseChannelCollection": "opt-out", + "description": "Was a userChrome.css stylesheet loaded when the profile was initialized?" + }, "WEBAUTHN_CREATE_CREDENTIAL_MS": { "record_in_processes": ["main"], "alert_emails": ["seceng-telemetry@mozilla.com", "jjones@mozilla.com"],