Bug 1631276 part 2: On non-Windows, have the parent process notify the content process when the DocAccessibleParent is constructed. r=eeejay

This is already handled in a different way on Windows.
For documents at the top level of their process (including OOP iframes), we can just set the flag rather than waiting for a message, since we can never get queries for such documents or descendants before parent process construction is complete.

Differential Revision: https://phabricator.services.mozilla.com/D81009
This commit is contained in:
James Teh 2020-06-29 18:12:44 +00:00
Родитель feb712c112
Коммит 06946181ec
6 изменённых файлов: 23 добавлений и 0 удалений

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

@ -1641,6 +1641,13 @@ void DocAccessible::DoInitialUpdate() {
ipcDoc->SendPDocAccessiblePlatformExtConstructor();
#endif
}
#if !defined(XP_WIN)
// It's safe for us to mark top level documents as constructed in the
// parent process without receiving an explicit message, since we can
// never get queries for this document or descendants before parent
// process construction is complete.
ipcDoc->SetConstructedInParentProcess();
#endif
}
}
}

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

@ -77,6 +77,8 @@ class DocAccessibleChildBase : public PDocAccessibleChild {
DocAccessible* mDoc;
bool mIsRemoteConstructed;
friend void DocAccessible::DoInitialUpdate();
};
} // namespace a11y

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

@ -1694,6 +1694,11 @@ mozilla::ipc::IPCResult DocAccessibleChild::RecvDOMNodeID(
return IPC_OK();
}
mozilla::ipc::IPCResult DocAccessibleChild::RecvConstructedInParentProcess() {
SetConstructedInParentProcess();
return IPC_OK();
}
mozilla::ipc::IPCResult DocAccessibleChild::RecvRestoreFocus() {
FocusMgr()->ForceFocusEvent();
return IPC_OK();

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

@ -38,6 +38,7 @@ class DocAccessibleChild : public DocAccessibleChildBase {
MOZ_COUNT_DTOR_INHERITED(DocAccessibleChild, DocAccessibleChildBase);
}
virtual mozilla::ipc::IPCResult RecvConstructedInParentProcess() override;
virtual mozilla::ipc::IPCResult RecvRestoreFocus() override;
/*

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

@ -124,6 +124,12 @@ parent:
async Batch(uint64_t aBatchType, BatchData[] aData);
child:
/*
* Notify the content process that the PDocAccessible has finished being
* constructed in the parent process.
*/
async ConstructedInParentProcess();
async __delete__();
/*

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

@ -1209,6 +1209,8 @@ mozilla::ipc::IPCResult BrowserParent::RecvPDocAccessibleConstructor(
if (a11y::nsWinUtils::IsWindowEmulationStarted()) {
doc->SetEmulatedWindowHandle(parentDoc->GetEmulatedWindowHandle());
}
# else
Unused << aDoc->SendConstructedInParentProcess();
# endif
return IPC_OK();