Bug 1431256 part 4: Remove IEnumVARIANT from the AccessibleHandler payload. r?MarcoZ
Now that the handler implements IEnumVARIANT itself (and uses our own internal method to retrieve the children), caching this remote interface is pointless.
MozReview-Commit-ID: FyagiEcHMP2
--- a/accessible/ipc/win/HandlerProvider.cpp
+++ b/accessible/ipc/win/HandlerProvider.cpp
@@ -214,22 +214,16 @@ HandlerProvider::BuildStaticIA2Data(
// IA2 should always be present, so something has
// gone very wrong if this fails.
aOutData->mIA2 = nullptr;
return;
}
// Some of these interfaces aren't present on all accessibles,
// so it's not a failure if these interfaces can't be fetched.
- hr = aInterceptor->GetInterceptorForIID(IID_IEnumVARIANT,
- (void**)&aOutData->mIEnumVARIANT);
- if (FAILED(hr)) {
- aOutData->mIEnumVARIANT = nullptr;
- }
-
hr = aInterceptor->GetInterceptorForIID(IID_IAccessibleHypertext2,
(void**)&aOutData->mIAHypertext);
if (FAILED(hr)) {
aOutData->mIAHypertext = nullptr;
}
hr = aInterceptor->GetInterceptorForIID(IID_IAccessibleHyperlink,
(void**)&aOutData->mIAHyperlink);
--- a/accessible/ipc/win/handler/AccessibleHandler.cpp
+++ b/accessible/ipc/win/handler/AccessibleHandler.cpp
@@ -353,19 +353,17 @@ AccessibleHandler::QueryHandlerInterface
return S_OK;
}
if (HasPayload()) {
// The proxy manager caches interfaces marshaled in the payload
// and returns them on QI without a cross-process call.
// However, it doesn't know about interfaces which don't exist.
// We can determine this from the payload.
- if ((aIid == IID_IEnumVARIANT &&
- !mCachedData.mStaticData.mIEnumVARIANT) ||
- ((aIid == IID_IAccessibleText || aIid == IID_IAccessibleHypertext ||
+ if (((aIid == IID_IAccessibleText || aIid == IID_IAccessibleHypertext ||
aIid == IID_IAccessibleHypertext2) &&
!mCachedData.mStaticData.mIAHypertext) ||
((aIid == IID_IAccessibleAction || aIid == IID_IAccessibleHyperlink) &&
!mCachedData.mStaticData.mIAHyperlink) ||
(aIid == IID_IAccessibleTable &&
!mCachedData.mStaticData.mIATable) ||
(aIid == IID_IAccessibleTable2 &&
!mCachedData.mStaticData.mIATable2) ||
@@ -403,16 +401,19 @@ AccessibleHandler::QueryHandlerInterface
if (aIid == IID_IProvideClassInfo) {
RefPtr<IProvideClassInfo> clsInfo(this);
clsInfo.forget(aOutInterface);
return S_OK;
}
if (aIid == IID_IEnumVARIANT && mCachedData.mGeckoBackChannel) {
+ if (&mCachedData.mDynamicData.mChildCount == 0) {
+ return E_NOINTERFACE;
+ }
RefPtr<IEnumVARIANT> childEnum(
new HandlerChildEnumerator(this, mCachedData.mGeckoBackChannel));
childEnum.forget(aOutInterface);
return S_OK;
}
return E_NOINTERFACE;
}
--- a/accessible/ipc/win/handler/HandlerData.idl
+++ b/accessible/ipc/win/handler/HandlerData.idl
@@ -2,31 +2,29 @@
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla-config.h"
#include "AccessibleHandler.h"
-import "oaidl.idl";
import "ocidl.idl";
import "ServProv.idl";
import "Accessible2_3.idl";
import "AccessibleHypertext2.idl";
import "AccessibleHyperlink.idl";
import "AccessibleTable.idl";
import "AccessibleTable2.idl";
import "AccessibleTableCell.idl";
typedef struct _StaticIA2Data
{
NEWEST_IA2_INTERFACE* mIA2;
- IEnumVARIANT* mIEnumVARIANT;
IAccessibleHypertext2* mIAHypertext;
IAccessibleHyperlink* mIAHyperlink;
IAccessibleTable* mIATable;
IAccessibleTable2* mIATable2;
IAccessibleTableCell* mIATableCell;
} StaticIA2Data;
typedef struct _DynamicIA2Data
--- a/accessible/ipc/win/handler/HandlerDataCleanup.h
+++ b/accessible/ipc/win/handler/HandlerDataCleanup.h
@@ -18,19 +18,16 @@ ReleaseStaticIA2DataInterfaces(StaticIA2
{
// Only interfaces of the proxied object wrapped by this handler should be
// released here, never other objects!
// For example, if StaticIA2Data were to include accParent in future,
// that must not be released here.
if (aData.mIA2) {
aData.mIA2->Release();
}
- if (aData.mIEnumVARIANT) {
- aData.mIEnumVARIANT->Release();
- }
if (aData.mIAHypertext) {
aData.mIAHypertext->Release();
}
if (aData.mIAHyperlink) {
aData.mIAHyperlink->Release();
}
if (aData.mIATable) {
aData.mIATable->Release();