Bug 1173418 - Check if a document is top level in DocAccessibleParent::Destroy so that RemoteDocShutdown isn't erroneously called r=tbsaunde

This commit is contained in:
Lorien Hu 2015-06-10 14:11:34 -04:00
Родитель db2464f3c0
Коммит 66a8fe1d95
3 изменённых файлов: 14 добавлений и 5 удалений

Просмотреть файл

@ -213,8 +213,11 @@ DocAccessibleParent::Destroy()
mAccessibles.EnumerateEntries(ShutdownAccessibles, nullptr);
ProxyDestroyed(this);
mParentDoc ? mParentDoc->RemoveChildDoc(this)
: GetAccService()->RemoteDocShutdown(this);
}
}
if (mParentDoc)
mParentDoc->RemoveChildDoc(this);
else if (IsTopLevel())
GetAccService()->RemoteDocShutdown(this);
}
} // a11y
} // mozilla

Просмотреть файл

@ -26,7 +26,8 @@ class DocAccessibleParent : public ProxyAccessible,
{
public:
DocAccessibleParent() :
ProxyAccessible(this), mParentDoc(nullptr), mShutdown(false)
ProxyAccessible(this), mParentDoc(nullptr),
mTopLevel(false), mShutdown(false)
{ MOZ_COUNT_CTOR_INHERITED(DocAccessibleParent, ProxyAccessible); }
~DocAccessibleParent()
{
@ -35,6 +36,9 @@ public:
MOZ_ASSERT(!ParentDoc());
}
void SetTopLevel() { mTopLevel = true; }
bool IsTopLevel() const { return mTopLevel; }
/*
* Called when a message from a document in a child process notifies the main
* process it is firing an event.
@ -151,6 +155,7 @@ private:
* proxy object so we can't use a real map.
*/
nsTHashtable<ProxyEntry> mAccessibles;
bool mTopLevel;
bool mShutdown;
};

Просмотреть файл

@ -1137,6 +1137,7 @@ TabParent::RecvPDocAccessibleConstructor(PDocAccessibleParent* aDoc,
return parentDoc->AddChildDoc(doc, aParentID);
} else {
MOZ_ASSERT(!aParentID);
doc->SetTopLevel();
a11y::DocManager::RemoteDocAdded(doc);
}
#endif