mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 13:25:37 +00:00
bug 1098386 - Allow PDocAccessibleConstructor to be recieved when gAccessibilityService doesn't exist r=surkov
Talos causes accessibility to be instantiated only in the content process. That means PDocAccessibleConstructor messages can be recieved by the parent when GetAccService() returns null. The easiest way of dealing with this is moving DocManager::mRemoteDocuments from a member of the acc service singleton to its own global. That means the parent process can track accessible documents in child processes without instantiating a11y in the parent process.
This commit is contained in:
parent
9fae9e4367
commit
429fb6858c
@ -36,6 +36,8 @@ using namespace mozilla;
|
||||
using namespace mozilla::a11y;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
nsTArray<DocAccessibleParent*> DocManager::sRemoteDocuments;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// DocManager
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -74,20 +74,20 @@ public:
|
||||
/*
|
||||
* Notification that a top level document in a content process has gone away.
|
||||
*/
|
||||
void RemoteDocShutdown(DocAccessibleParent* aDoc)
|
||||
static void RemoteDocShutdown(DocAccessibleParent* aDoc)
|
||||
{
|
||||
DebugOnly<bool> result = mRemoteDocuments.RemoveElement(aDoc);
|
||||
DebugOnly<bool> result = sRemoteDocuments.RemoveElement(aDoc);
|
||||
MOZ_ASSERT(result, "Why didn't we find the document!");
|
||||
}
|
||||
|
||||
/*
|
||||
* Notify of a new top level document in a content process.
|
||||
*/
|
||||
void RemoteDocAdded(DocAccessibleParent* aDoc)
|
||||
static void RemoteDocAdded(DocAccessibleParent* aDoc)
|
||||
{
|
||||
MOZ_ASSERT(!mRemoteDocuments.Contains(aDoc),
|
||||
MOZ_ASSERT(!sRemoteDocuments.Contains(aDoc),
|
||||
"How did we already have the doc!");
|
||||
mRemoteDocuments.AppendElement(aDoc);
|
||||
sRemoteDocuments.AppendElement(aDoc);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -176,7 +176,7 @@ private:
|
||||
/*
|
||||
* The list of remote top level documents.
|
||||
*/
|
||||
nsTArray<DocAccessibleParent*> mRemoteDocuments;
|
||||
static nsTArray<DocAccessibleParent*> sRemoteDocuments;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -2864,7 +2864,7 @@ ContentParent::RecvPDocAccessibleConstructor(PDocAccessibleParent* aDoc, PDocAcc
|
||||
return parentDoc->AddChildDoc(doc, aParentID);
|
||||
} else {
|
||||
MOZ_ASSERT(!aParentID);
|
||||
GetAccService()->RemoteDocAdded(doc);
|
||||
a11y::DocManager::RemoteDocAdded(doc);
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user