Bug 1633650: mscom::Interceptor: Don't call HandlerProvider::GetPayloadSize for external process callers. r=aklotz

When an Interceptor is marshaled for an external (non-chrome) process caller, we do not provide a handler and thus don't call HandlerProvider::WriteHandlerPayload.
However, GetMarshalSizeMax previously called HandlerProvider::GetPayloadSize even for external process callers.
For a11y's handlerProvider, we must build the payload to get the size.
This is wasteful in this case, since we're just going to throw it away.

Differential Revision: https://phabricator.services.mozilla.com/D72796
This commit is contained in:
James Teh 2020-04-28 16:21:58 +00:00
Родитель 350170619f
Коммит c697d1edde
1 изменённых файлов: 9 добавлений и 0 удалений

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

@ -302,6 +302,15 @@ Interceptor::GetMarshalSizeMax(REFIID riid, void* pv, DWORD dwDestContext,
return hr;
}
#if defined(MOZ_MSCOM_REMARSHAL_NO_HANDLER)
if (XRE_IsContentProcess() && IsCallerExternalProcess()) {
// The caller isn't our chrome process, so we do not provide a handler
// payload. Even though we're only getting the size here, calculating the
// payload size might actually require building the payload.
return hr;
}
#endif // defined(MOZ_MSCOM_REMARSHAL_NO_HANDLER)
DWORD payloadSize = 0;
hr = mEventSink->GetHandlerPayloadSize(WrapNotNull(this),
WrapNotNull(&payloadSize));