Bug 1896816: Fail gracefully if a naughty client tries to QueryInterface on an MsaaAccessible from the wrong thread. r=eeejay

JAWS apparently does this sometimes.
In particular, this was causing a crash when we tried to check the UIA pref because that pref can only be accessed from the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D210417
This commit is contained in:
James Teh 2024-05-15 21:59:03 +00:00
Родитель 4ac50f3930
Коммит 0156e587e9
1 изменённых файлов: 7 добавлений и 0 удалений

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

@ -508,6 +508,13 @@ MsaaAccessible::QueryInterface(REFIID iid, void** ppv) {
return E_NOINTERFACE;
}
if (NS_WARN_IF(!NS_IsMainThread())) {
// Bug 1896816: JAWS sometimes traverses into Gecko UI from a file dialog
// thread. It shouldn't do that, but let's fail gracefully instead of
// crashing.
return RPC_E_WRONG_THREAD;
}
// These interfaces are always available. We can support querying to them
// even if the Accessible is dead.
if (IID_IUnknown == iid) {