bug 1241453 - assert accessibles are only added to non remote xpcAccessibleDocuments r=davidb

This commit is contained in:
Trevor Saunders 2016-01-19 11:46:00 -05:00
parent 973d0ef356
commit 5aa2104440
2 changed files with 6 additions and 2 deletions

View File

@ -168,6 +168,7 @@ xpcAccessibleDocument::GetVirtualCursor(nsIAccessiblePivot** aVirtualCursor)
xpcAccessibleGeneric*
xpcAccessibleDocument::GetAccessible(Accessible* aAccessible)
{
MOZ_ASSERT(!mRemote);
if (ToXPCDocument(aAccessible->Document()) != this) {
NS_ERROR("This XPCOM document is not related with given internal accessible!");
return nullptr;

View File

@ -25,10 +25,11 @@ class xpcAccessibleDocument : public xpcAccessibleHyperText,
{
public:
explicit xpcAccessibleDocument(DocAccessible* aIntl) :
xpcAccessibleHyperText(aIntl), mCache(kDefaultCacheLength) { }
xpcAccessibleHyperText(aIntl), mCache(kDefaultCacheLength), mRemote(false) { }
xpcAccessibleDocument(ProxyAccessible* aProxy, uint32_t aInterfaces) :
xpcAccessibleHyperText(aProxy, aInterfaces), mCache(kDefaultCacheLength) {}
xpcAccessibleHyperText(aProxy, aInterfaces), mCache(kDefaultCacheLength),
mRemote(true) {}
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(xpcAccessibleDocument,
@ -72,6 +73,7 @@ private:
void NotifyOfShutdown(Accessible* aAccessible)
{
MOZ_ASSERT(!mRemote);
xpcAccessibleGeneric* xpcAcc = mCache.GetWeak(aAccessible);
if (xpcAcc)
xpcAcc->Shutdown();
@ -86,6 +88,7 @@ private:
xpcAccessibleDocument& operator =(const xpcAccessibleDocument&) = delete;
nsRefPtrHashtable<nsPtrHashKey<const void>, xpcAccessibleGeneric> mCache;
bool mRemote;
};
inline xpcAccessibleGeneric*