From 6da472c7c2b5a167d33cf08bf0b11e56cb72c0eb Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Tue, 26 Mar 2013 22:18:56 -0700 Subject: [PATCH] Bug 790732 - Components shim telemetry. r=mrbkap --- dom/base/nsDOMClassInfo.cpp | 3 +++ toolkit/components/telemetry/Histograms.json | 4 ++++ 2 files changed, 7 insertions(+) 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",