Bug 1278294 - make TreeInfo to log document address, r=yzen
authorAlexander Surkov <surkov.alexander@gmail.com>
Tue, 07 Jun 2016 17:20:12 -0400
changeset 300922 2b197e09ce5b50e40d153ac6ae3dfaadb9fd9346
parent 300921 fb0507f42e74128627a5fad0c82d5f1cbe435d93
child 300923 624915556f35d7e47f691ad1f914605ea14899b1
push id78138
push usersurkov.alexander@gmail.com
push dateTue, 07 Jun 2016 21:20:23 +0000
treeherdermozilla-inbound@2b197e09ce5b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyzen
bugs1278294
milestone50.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 1278294 - make TreeInfo to log document address, r=yzen
accessible/base/Logging.cpp
--- a/accessible/base/Logging.cpp
+++ b/accessible/base/Logging.cpp
@@ -612,23 +612,29 @@ logging::SelChange(nsISelection* aSelect
 
   Stack();
 }
 
 void
 logging::TreeInfo(const char* aMsg, uint32_t aExtraFlags, ...)
 {
   if (IsEnabledAll(logging::eTree | aExtraFlags)) {
-    MsgBegin("TREE", aMsg);
-
     va_list vl;
     va_start(vl, aExtraFlags);
-    const char* descr = nullptr;
-    while ((descr = va_arg(vl, const char*))) {
-      AccessibleInfo(descr, va_arg(vl, Accessible*));
+    const char* descr = va_arg(vl, const char*);
+    if (descr) {
+      Accessible* acc = va_arg(vl, Accessible*);
+      MsgBegin("TREE", "%s; doc: %p", aMsg, acc ? acc->Document() : nullptr);
+      AccessibleInfo(descr, acc);
+      while ((descr = va_arg(vl, const char*))) {
+        AccessibleInfo(descr, va_arg(vl, Accessible*));
+      }
+    }
+    else {
+      MsgBegin("TREE", aMsg);
     }
     va_end(vl);
 
     MsgEnd();
 
     if (aExtraFlags & eStack) {
       Stack();
     }
@@ -636,17 +642,17 @@ logging::TreeInfo(const char* aMsg, uint
 }
 
 void
 logging::TreeInfo(const char* aMsg, uint32_t aExtraFlags,
                   const char* aMsg1, Accessible* aAcc,
                   const char* aMsg2, nsINode* aNode)
 {
   if (IsEnabledAll(logging::eTree | logging::eVerbose)) {
-    MsgBegin("TREE", aMsg);
+    MsgBegin("TREE", "%s; doc: %p", aMsg, aAcc ? aAcc->Document() : nullptr);
     AccessibleInfo(aMsg1, aAcc);
     Accessible* acc = aAcc->Document()->GetAccessible(aNode);
     if (acc) {
       AccessibleInfo(aMsg2, acc);
     }
     else {
       Node(aMsg2, aNode);
     }
@@ -654,17 +660,17 @@ logging::TreeInfo(const char* aMsg, uint
   }
 }
 
 
 void
 logging::TreeInfo(const char* aMsg, uint32_t aExtraFlags, Accessible* aParent)
 {
   if (IsEnabledAll(logging::eTree | aExtraFlags)) {
-    MsgBegin("TREE", aMsg);
+    MsgBegin("TREE", "%s; doc: %p", aMsg, aParent->Document());
     AccessibleInfo("container", aParent);
     for (uint32_t idx = 0; idx < aParent->ChildCount(); idx++) {
       AccessibleInfo("child", aParent->GetChildAt(idx));
     }
     MsgEnd();
   }
 }