diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index ce943de33091..6dfc8380a433 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -5209,6 +5209,9 @@ const InterfaceShimEntry kInterfaceShimMap[] = static nsresult DefineComponentsShim(JSContext *cx, JS::HandleObject global) { + // Keep track of how often this happens. + Telemetry::Accumulate(Telemetry::COMPONENTS_SHIM_ACCESSED_BY_CONTENT, true); + // Create a fake Components object. JSObject *components = JS_NewObject(cx, nullptr, nullptr, global); NS_ENSURE_TRUE(components, NS_ERROR_OUT_OF_MEMORY); diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index bf03877c3675..f4101c8de78d 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -2895,6 +2895,10 @@ "kind": "flag", "description": "Whether content ever accesed Components.interfaces in this session" }, + "COMPONENTS_SHIM_ACCESSED_BY_CONTENT": { + "kind": "flag", + "description": "Whether content ever accesed the Components shim in this session" + }, "CHECK_ADDONS_MODIFIED_MS": { "kind": "exponential", "high": "5000",