From 2b74d8316f480c2e436abb2ca8466d211504b428 Mon Sep 17 00:00:00 2001 From: Andrzej Skalski Date: Wed, 8 Feb 2012 16:21:21 +0900 Subject: [PATCH] Bug 717506 - telemetry for xforms use, r=surkov, tbsaunde --- accessible/src/base/Statistics.h | 9 ++++++++- accessible/src/xforms/nsXFormsAccessible.cpp | 2 ++ toolkit/components/telemetry/TelemetryHistograms.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/accessible/src/base/Statistics.h b/accessible/src/base/Statistics.h index 0c59dd83812..7b541a21eee 100644 --- a/accessible/src/base/Statistics.h +++ b/accessible/src/base/Statistics.h @@ -22,6 +22,7 @@ * * Contributor(s): * Trevor Saunders (original author) + * Andrzej Skalski * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -47,7 +48,7 @@ namespace a11y { namespace statistics { inline void A11yInitialized() - { Telemetry::Accumulate(Telemetry::A11Y_INSTANTIATED, true); } + { Telemetry::Accumulate(Telemetry::A11Y_INSTANTIATED, 1); } inline void A11yConsumers(PRUint32 aConsumer) { Telemetry::Accumulate(Telemetry::A11Y_CONSUMERS, aConsumer); } @@ -70,6 +71,12 @@ namespace statistics { inline void IAccessibleTableUsed() { Telemetry::Accumulate(Telemetry::IACCESSIBLE_TABLE_USAGE, 1); } + /** + * Report that XForms accessibility has been instantiated. + */ + inline void XFormsAccessibleUsed() + { Telemetry::Accumulate(Telemetry::XFORMS_ACCESSIBLE_USED, 1); } + } // namespace statistics } // namespace a11y } // namespace mozilla diff --git a/accessible/src/xforms/nsXFormsAccessible.cpp b/accessible/src/xforms/nsXFormsAccessible.cpp index c4d37f83eaf..d58aa016243 100644 --- a/accessible/src/xforms/nsXFormsAccessible.cpp +++ b/accessible/src/xforms/nsXFormsAccessible.cpp @@ -43,6 +43,7 @@ #include "nsTextEquivUtils.h" #include "Role.h" #include "States.h" +#include "Statistics.h" #include "nscore.h" #include "nsServiceManagerUtils.h" @@ -70,6 +71,7 @@ nsXFormsAccessibleBase::nsXFormsAccessibleBase() if (NS_FAILED(rv)) NS_WARNING("No XForms utility service."); } + statistics::XFormsAccessibleUsed(); } //////////////////////////////////////////////////////////////////////////////// diff --git a/toolkit/components/telemetry/TelemetryHistograms.h b/toolkit/components/telemetry/TelemetryHistograms.h index 5d4a9e7eac2..d7aadf23bcd 100644 --- a/toolkit/components/telemetry/TelemetryHistograms.h +++ b/toolkit/components/telemetry/TelemetryHistograms.h @@ -59,6 +59,7 @@ HISTOGRAM_BOOLEAN(A11Y_INSTANTIATED, "has accessibility support been instantiate HISTOGRAM(A11Y_CONSUMERS, 1, 6, 7, LINEAR, "Accessibility client by enum id") HISTOGRAM_BOOLEAN(ISIMPLE_DOM_USAGE, "have the ISimpleDOM* accessibility interfaces been used") HISTOGRAM_BOOLEAN(IACCESSIBLE_TABLE_USAGE, "has the IAccessibleTable accessibility interface been used") +HISTOGRAM_BOOLEAN(XFORMS_ACCESSIBLE_USED, "has XForms accessibility been instantiated") /** * Cycle collector telemetry