Bug 1386798: Add profiler markers for a11y events; r=surkov
authorAaron Klotz <aklotz@mozilla.com>
Wed, 02 Aug 2017 15:31:08 -0600
changeset 373533 9a678b3efcd23bbe3a62b76c8113384ec7714cec
parent 373428 99837e8b5a692ac96257d2bae03a3867c4c80e7e
child 373534 5218fdb57fa7c2866bc32d44556e318fcec7887b
push id32304
push usercbook@mozilla.com
push dateWed, 09 Aug 2017 09:37:21 +0000
treeherdermozilla-central@4c5fbf493763 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs1386798
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1386798: Add profiler markers for a11y events; r=surkov MozReview-Commit-ID: EGvmB9qbKKx
accessible/generic/Accessible.cpp
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -13,16 +13,17 @@
 #include "nsAccUtils.h"
 #include "nsAccessibilityService.h"
 #include "ApplicationAccessible.h"
 #include "NotificationController.h"
 #include "nsEventShell.h"
 #include "nsTextEquivUtils.h"
 #include "DocAccessibleChild.h"
 #include "EventTree.h"
+#include "GeckoProfiler.h"
 #include "Relation.h"
 #include "Role.h"
 #include "RootAccessible.h"
 #include "States.h"
 #include "StyleInfo.h"
 #include "TableAccessible.h"
 #include "TableCellAccessible.h"
 #include "TreeWalker.h"
@@ -839,16 +840,23 @@ Accessible::XULElmName(DocAccessible* aD
   }
 }
 
 nsresult
 Accessible::HandleAccEvent(AccEvent* aEvent)
 {
   NS_ENSURE_ARG_POINTER(aEvent);
 
+  if (profiler_is_active()) {
+    nsAutoCString strEventType;
+    GetAccService()->GetStringEventType(aEvent->GetEventType(), strEventType);
+
+    profiler_tracing("A11y Event", strEventType.get());
+  }
+
   if (IPCAccessibilityActive() && Document()) {
     DocAccessibleChild* ipcDoc = mDoc->IPCDoc();
     MOZ_ASSERT(ipcDoc);
     if (ipcDoc) {
       uint64_t id = aEvent->GetAccessible()->IsDoc() ? 0 :
         reinterpret_cast<uintptr_t>(aEvent->GetAccessible());
 
       switch(aEvent->GetEventType()) {