Bug 1348273 - Convert the accessibility annotations; r?surkov draft
authorGabriele Svelto <gsvelto@mozilla.com>
Fri, 16 Mar 2018 21:21:08 +0100
changeset 776639 33bc5c97726654f3a586e61a7384d365736d532d
parent 776638 0fb749c264b2b2575d4de1ed2a1fcb626b514389
child 776640 74696d272ff37dd5c6173ebcc201f664f4b95a49
push id104933
push usergsvelto@mozilla.com
push dateTue, 03 Apr 2018 14:35:30 +0000
reviewerssurkov
bugs1348273
milestone61.0a1
Bug 1348273 - Convert the accessibility annotations; r?surkov MozReview-Commit-ID: 8PaNpnD7KVU
accessible/base/nsAccessibilityService.cpp
accessible/windows/msaa/Compatibility.cpp
accessible/windows/msaa/LazyInstantiator.cpp
accessible/windows/msaa/Platform.cpp
toolkit/crashreporter/CrashAnnotations.yaml
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -1383,17 +1383,17 @@ nsAccessibilityService::Init()
     gApplicationAccessible = new ApplicationAccessible();
 #endif // defined(XP_WIN)
   }
 
   NS_ADDREF(gApplicationAccessible); // will release in Shutdown()
   gApplicationAccessible->Init();
 
   CrashReporter::
-    AnnotateCrashReport(NS_LITERAL_CSTRING("Accessibility"),
+    AnnotateCrashReport(CrashReporter::Annotation::Accessibility,
                         NS_LITERAL_CSTRING("Active"));
 
 #ifdef XP_WIN
   sPendingPlugins = new nsTArray<nsCOMPtr<nsIContent> >;
   sPluginTimers = new nsTArray<nsCOMPtr<nsITimer> >;
 #endif
 
   // Now its safe to start platform accessibility.
--- a/accessible/windows/msaa/Compatibility.cpp
+++ b/accessible/windows/msaa/Compatibility.cpp
@@ -236,17 +236,17 @@ Compatibility::HasKnownNonUiaConsumer()
 
 void
 Compatibility::Init()
 {
   // Note we collect some AT statistics/telemetry here for convenience.
   InitConsumers();
 
   CrashReporter::
-    AnnotateCrashReport(NS_LITERAL_CSTRING("AccessibilityInProcClient"),
+    AnnotateCrashReport(CrashReporter::Annotation::AccessibilityInProcClient,
                         nsPrintfCString("0x%X", sConsumers));
 
   // Gather telemetry
   uint32_t temp = sConsumers;
   for (int i = 0; temp; i++) {
     if (temp & 0x1)
       statistics::A11yConsumers(i);
 
@@ -432,18 +432,19 @@ UseIAccessibleProxyStub()
   // Otherwise we try the proxy/stub
   if (IsIAccessiblePSRegistered()) {
     return true;
   }
 
   // If we reach this point then something is seriously wrong with the
   // IAccessible configuration in the computer's registry. Let's annotate this
   // so that we can easily determine this condition during crash analysis.
-  CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IAccessibleConfig"),
-                                     NS_LITERAL_CSTRING("NoSystemTypeLibOrPS"));
+  CrashReporter::AnnotateCrashReport(
+    CrashReporter::Annotation::IAccessibleConfig,
+    NS_LITERAL_CSTRING("NoSystemTypeLibOrPS"));
   return false;
 }
 
 #endif // !defined(HAVE_64BIT_BUILD)
 
 uint16_t
 Compatibility::GetActCtxResourceId()
 {
--- a/accessible/windows/msaa/LazyInstantiator.cpp
+++ b/accessible/windows/msaa/LazyInstantiator.cpp
@@ -12,17 +12,16 @@
 #include "mozilla/a11y/Platform.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/mscom/MainThreadRuntime.h"
 #include "mozilla/mscom/Registration.h"
 #include "mozilla/UniquePtr.h"
 #include "nsAccessibilityService.h"
 #include "nsWindowsHelpers.h"
 #include "nsCOMPtr.h"
-#include "nsExceptionHandler.h"
 #include "nsIFile.h"
 #include "nsXPCOM.h"
 #include "RootAccessibleWrap.h"
 #include "WinUtils.h"
 
 #include <oaidl.h>
 
 #if !defined(STATE_SYSTEM_NORMAL)
--- a/accessible/windows/msaa/Platform.cpp
+++ b/accessible/windows/msaa/Platform.cpp
@@ -341,17 +341,17 @@ AccumulateInstantiatorTelemetry(const ns
 
   if (!aValue.IsEmpty()) {
 #if defined(MOZ_TELEMETRY_REPORTING)
     Telemetry::ScalarSet(Telemetry::ScalarID::A11Y_INSTANTIATORS,
                          aValue);
 #endif // defined(MOZ_TELEMETRY_REPORTING)
 #if defined(MOZ_CRASHREPORTER)
     CrashReporter::
-      AnnotateCrashReport(NS_LITERAL_CSTRING("AccessibilityClient"),
+      AnnotateCrashReport(CrashReporter::Annotation::AccessibilityClient,
                           NS_ConvertUTF16toUTF8(aValue));
 #endif // defined(MOZ_CRASHREPORTER)
   }
 }
 
 static void
 GatherInstantiatorTelemetry(nsIFile* aClientExe)
 {
--- a/toolkit/crashreporter/CrashAnnotations.yaml
+++ b/toolkit/crashreporter/CrashAnnotations.yaml
@@ -7,16 +7,32 @@
 # Additionally a field can have the following optional fields:
 # - altname: A string that will be used when writing out the annotation to the
 #   .extra file instead of the annotation name
 # - ping: A boolean that indicates whether the annotation is whitelisted for
 #   going into the crash ping, if not specified this defaults to false
 # - content: A boolean that indicates whether the field will be included in
 #   subprocess reports, if not specified this defaults to true
 
+Accessibility:
+  description: >
+    Set to "Active" by the accessibility service when it is active.
+  type: string
+
+AccessibilityClient:
+  description: >
+    Set by the out-of-process accessibility client in case of failure.
+  type: string
+
+AccessibilityInProcClient:
+  description: >
+    Hexadecimal mask of accessibility consumers, see
+    accessible/windows/msaa/Compatibility.h for the mappings.
+  type: string
+
 AvailablePageFile:
   description: >
     Windows-only, maximum amount of memory that can be committed.  This
     annotation is populated with the contents of the MEMORYSTATUSEX's structure
     ullAvailPageFile field.
   type: string
   ping: true
 
@@ -72,16 +88,22 @@ CrashTime:
 
 EventLoopNestingLevel:
   description: >
     Present only if higher than 0, indicates that we're running in a nested
     event loop and indicates the nesting level.
   type: integer
   ping: true
 
+IAccessibleConfig:
+  description: >
+    Set when something is seriously wrong with the IAccessible configuration in
+    the computer's registry. The value is always set to "NoSystemTypeLibOrPS"
+  type: string
+
 InstallTime:
   description: >
     The time when Firefox was installed expressed as seconds since the Epoch
   type: integer
 
 IsGarbageCollecting:
   description: >
     If true then the JavaScript garbage collector was running when the crash