From a8e80485cd287177de4486c6911c753ff7c52380 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Sat, 16 Nov 2024 02:51:58 +0000 Subject: [PATCH] Bug 1918166: Extend js::Metrics to also record telemetry to glean without a legacy mirror. r=tcampbell Differential Revision: https://phabricator.services.mozilla.com/D229005 UltraBlame original commit: 261fcdc7813b8c7d06d3feb39001fc40909eaede --- js/public/friend/UsageStatistics.h | 24 +++++++++++++++++++++++- js/xpconnect/src/XPCJSRuntime.cpp | 11 ++--------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/js/public/friend/UsageStatistics.h b/js/public/friend/UsageStatistics.h index b1003bfabbe0..9a0cb1bd8117 100644 --- a/js/public/friend/UsageStatistics.h +++ b/js/public/friend/UsageStatistics.h @@ -28,7 +28,7 @@ JSObject ; # define -FOR_EACH_JS_METRIC +FOR_EACH_JS_LEGACY_METRIC ( _ ) @@ -310,6 +310,28 @@ TimeDuration_US ) # define +FOR_EACH_JS_GLEAN_METRIC +( +_ +) +# +define +FOR_EACH_JS_METRIC +( +_ +) +\ +FOR_EACH_JS_LEGACY_METRIC +( +_ +) +\ +FOR_EACH_JS_GLEAN_METRIC +( +_ +) +# +define ENUM_DEF ( NAME diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index f2f4c7d39d46..32b303b8124a 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -14634,7 +14634,7 @@ sample \ break ; -FOR_EACH_JS_METRIC +FOR_EACH_JS_LEGACY_METRIC ( CASE_ACCUMULATE ) @@ -14643,14 +14643,7 @@ undef CASE_ACCUMULATE default : -MOZ_CRASH -( -" -Bad -metric -id -" -) +break ; } switch