Bug 1367715: Check for IClientSecurity in a11y QueryInterface implementations; r=surkov

MozReview-Commit-ID: FwGEq5GLom1

--HG--
extra : rebase_source : 73e2e1e494e75cb1126583ca947208025a533690
This commit is contained in:
Aaron Klotz 2017-05-31 16:07:30 -06:00
parent 5e1f870e91
commit e4ffc15186
2 changed files with 16 additions and 0 deletions

View File

@ -118,6 +118,14 @@ AccessibleWrap::QueryInterface(REFIID iid, void** ppv)
*ppv = nullptr;
if (IID_IClientSecurity == iid) {
// Some code might QI(IID_IClientSecurity) to detect whether or not we are
// a proxy. Right now that can potentially happen off the main thread, so we
// look for this condition immediately so that we don't trigger other code
// that might not be thread-safe.
return E_NOINTERFACE;
}
if (IID_IUnknown == iid)
*ppv = static_cast<IAccessible*>(this);
else if (IID_IDispatch == iid || IID_IAccessible == iid)

View File

@ -39,6 +39,14 @@ sdnAccessible::QueryInterface(REFIID aREFIID, void** aInstancePtr)
return E_FAIL;
*aInstancePtr = nullptr;
if (aREFIID == IID_IClientSecurity) {
// Some code might QI(IID_IClientSecurity) to detect whether or not we are
// a proxy. Right now that can potentially happen off the main thread, so we
// look for this condition immediately so that we don't trigger other code
// that might not be thread-safe.
return E_NOINTERFACE;
}
if (aREFIID == IID_ISimpleDOMNode) {
*aInstancePtr = static_cast<ISimpleDOMNode*>(this);
AddRef();