Backed out changeset eb97347c9690 (bug 1340579) for a11y assertion failures and PLDHashTable crashes
authorPhil Ringnalda <philringnalda@gmail.com>
Fri, 24 Feb 2017 20:56:38 -0800
changeset 373954 5144d2aa92af110e8fdf3ea377524a201990f882
parent 373953 4c67f9e2c412af99c07874b1ffa9e10dd62b613a
child 373955 e9764fc002e8791215e13accf181ad5902c85d09
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1340579
milestone54.0a1
backs outeb97347c9690ad2f64890fe1f0f97c980e25f004
Backed out changeset eb97347c9690 (bug 1340579) for a11y assertion failures and PLDHashTable crashes CLOSED TREE
accessible/ipc/DocAccessibleParent.cpp
--- a/accessible/ipc/DocAccessibleParent.cpp
+++ b/accessible/ipc/DocAccessibleParent.cpp
@@ -472,54 +472,34 @@ DocAccessibleParent::Destroy()
 
   uint32_t childDocCount = mChildDocs.Length();
   for (uint32_t i = 0; i < childDocCount; i++) {
     for (uint32_t j = i + 1; j < childDocCount; j++) {
       MOZ_DIAGNOSTIC_ASSERT(mChildDocs[i] != mChildDocs[j]);
     }
   }
 
-  int32_t actorID = IProtocol::Id();
-  for (uint32_t i = childDocCount - 1; i < childDocCount; i--) {
-    DocAccessibleParent* thisDoc = LiveDocs().Get(actorID);
-    MOZ_ASSERT(thisDoc);
-    if (!thisDoc) {
-      break;
-    }
-
-    thisDoc->ChildDocAt(i)->Destroy();
-  }
+  for (uint32_t i = childDocCount - 1; i < childDocCount; i--)
+    ChildDocAt(i)->Destroy();
 
   for (auto iter = mAccessibles.Iter(); !iter.Done(); iter.Next()) {
     MOZ_ASSERT(iter.Get()->mProxy != this);
     ProxyDestroyed(iter.Get()->mProxy);
     iter.Remove();
   }
 
   // The code above should have already completely cleared these, but to be
   // extra safe make sure they are cleared here.
-  DocAccessibleParent* thisDoc = LiveDocs().Get(actorID);
-  MOZ_ASSERT(thisDoc);
-  if (!thisDoc) {
-    return;
-  }
-
-  thisDoc->mAccessibles.Clear();
-  thisDoc->mChildDocs.Clear();
+  mAccessibles.Clear();
+  mChildDocs.Clear();
 
-  DocManager::NotifyOfRemoteDocShutdown(thisDoc);
-  ProxyDestroyed(thisDoc);
-  thisDoc = LiveDocs().Get(actorID);
-  MOZ_ASSERT(thisDoc);
-  if (!thisDoc) {
-    return;
-  }
-
-  if (DocAccessibleParent* parentDoc = thisDoc->ParentDoc())
-    parentDoc->RemoveChildDoc(thisDoc);
+  DocManager::NotifyOfRemoteDocShutdown(this);
+  ProxyDestroyed(this);
+  if (DocAccessibleParent* parentDoc = ParentDoc())
+    parentDoc->RemoveChildDoc(this);
   else if (IsTopLevel())
     GetAccService()->RemoteDocShutdown(this);
 }
 
 DocAccessibleParent*
 DocAccessibleParent::ParentDoc() const
 {
   if (mParentDoc == kNoParentDoc) {