Backed out changeset 18151dec259d (bug 1184217) for causing bug 1329644
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 10 Jan 2017 16:55:37 +0100
changeset 328735 e68cbc3b5b3d3fba4fe3e17e234713020f44e4a0
parent 328734 2c85b6401be3a9e67e985e62b82b2a8277338880
child 328736 028f5f89557b3059a2b1547c34b3cf50b376c72e
child 328810 7c54af30e12bdb70a36fdd811e447b0c2f675b79
child 328819 20094311ab5ec56d5be7afc6d5c2e2b09e656fb2
push id85519
push usercbook@mozilla.com
push dateTue, 10 Jan 2017 15:58:10 +0000
treeherdermozilla-inbound@028f5f89557b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1184217, 1329644
milestone53.0a1
backs out18151dec259d835de31c4750d278d218b5da783e
first release with
nightly linux32
e68cbc3b5b3d / 53.0a1 / 20170110075905 / files
nightly linux64
e68cbc3b5b3d / 53.0a1 / 20170110075905 / files
nightly mac
e68cbc3b5b3d / 53.0a1 / 20170110075905 / files
nightly win32
e68cbc3b5b3d / 53.0a1 / 20170110075905 / files
nightly win64
e68cbc3b5b3d / 53.0a1 / 20170110075905 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 18151dec259d (bug 1184217) for causing bug 1329644
accessible/ipc/DocAccessibleParent.cpp
accessible/ipc/DocAccessibleParent.h
--- a/accessible/ipc/DocAccessibleParent.cpp
+++ b/accessible/ipc/DocAccessibleParent.cpp
@@ -434,61 +434,41 @@ DocAccessibleParent::Destroy()
   DocManager::NotifyOfRemoteDocShutdown(this);
   ProxyDestroyed(this);
   if (mParentDoc)
     mParentDoc->RemoveChildDoc(this);
   else if (IsTopLevel())
     GetAccService()->RemoteDocShutdown(this);
 }
 
+bool
+DocAccessibleParent::CheckDocTree() const
+{
+  size_t childDocs = mChildDocs.Length();
+  for (size_t i = 0; i < childDocs; i++) {
+    if (!mChildDocs[i] || mChildDocs[i]->mParentDoc != this)
+      return false;
+
+    if (!mChildDocs[i]->CheckDocTree()) {
+      return false;
+    }
+  }
+
+  return true;
+}
+
 xpcAccessibleGeneric*
 DocAccessibleParent::GetXPCAccessible(ProxyAccessible* aProxy)
 {
   xpcAccessibleDocument* doc = GetAccService()->GetXPCDocument(this);
   MOZ_ASSERT(doc);
 
   return doc->GetXPCAccessible(aProxy);
 }
 
-bool
-DocAccessibleParent::CheckDocTreeInternal() const
-{
-  size_t childDocs = mChildDocs.Length();
-  for (size_t i = 0; i < childDocs; i++) {
-    if (!mChildDocs[i] || mChildDocs[i]->mParentDoc != this)
-      return false;
-
-    if (!mChildDocs[i]->CheckDocTreeInternal()) {
-      return false;
-    }
-  }
-
-  return true;
-}
-
-const DocAccessibleParent*
-DocAccessibleParent::CheckTopDoc() const
-{
-  const DocAccessibleParent* doc = this;
-  while (doc->ParentDoc()) {
-    doc = doc->ParentDoc();
-  }
-
-  MOZ_DIAGNOSTIC_ASSERT(doc->mTopLevel);
-  MOZ_DIAGNOSTIC_ASSERT(DocManager::TopLevelRemoteDocs()->Contains(doc));
-
-  return doc;
-}
-
-bool
-DocAccessibleParent::CheckDocTree() const
-{
-  return CheckTopDoc()->CheckDocTreeInternal();
-}
-
 #if defined(XP_WIN)
 /**
  * @param aCOMProxy COM Proxy to the document in the content process.
  */
 void
 DocAccessibleParent::SetCOMProxy(const RefPtr<IAccessible>& aCOMProxy)
 {
   SetCOMInterface(aCOMProxy);
--- a/accessible/ipc/DocAccessibleParent.h
+++ b/accessible/ipc/DocAccessibleParent.h
@@ -82,22 +82,19 @@ public:
 
     mParent = nullptr;
   }
 
   virtual mozilla::ipc::IPCResult RecvShutdown() override;
   void Destroy();
   virtual void ActorDestroy(ActorDestroyReason aWhy) override
   {
-    if (mShutdown) {
-      return;
-    }
-
     MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
-    Destroy();
+    if (!mShutdown)
+      Destroy();
   }
 
   /*
    * Return the main processes representation of the parent document (if any)
    * of the document this object represents.
    */
   DocAccessibleParent* ParentDoc() const { return mParentDoc; }
 
@@ -175,20 +172,18 @@ private:
     enum { ALLOW_MEMMOVE = true };
 
     ProxyAccessible* mProxy;
   };
 
   uint32_t AddSubtree(ProxyAccessible* aParent,
                       const nsTArray<AccessibleData>& aNewTree, uint32_t aIdx,
                       uint32_t aIdxInParent);
+  MOZ_MUST_USE bool CheckDocTree() const;
   xpcAccessibleGeneric* GetXPCAccessible(ProxyAccessible* aProxy);
-  MOZ_MUST_USE bool CheckDocTree() const;
-  MOZ_MUST_USE bool CheckDocTreeInternal() const;
-  const DocAccessibleParent* CheckTopDoc() const;
 
   nsTArray<DocAccessibleParent*> mChildDocs;
   DocAccessibleParent* mParentDoc;
 
   /*
    * Conceptually this is a map from IDs to proxies, but we store the ID in the
    * proxy object so we can't use a real map.
    */