Bug 1395840: Backed out changeset e7f2eaf99d46 on suspicion of breaking virtual buffers in a11y clients; r=backout

This commit is contained in:
Aaron Klotz 2017-09-01 10:44:41 -06:00
Родитель c47048d751
Коммит 693b60cf9c
3 изменённых файлов: 11 добавлений и 19 удалений

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

@ -193,23 +193,13 @@ Interceptor::GetClassForHandler(DWORD aDestContext, void* aDestContextPtr,
return mEventSink->GetHandler(WrapNotNull(aHandlerClsid));
}
REFIID
Interceptor::MarshalAs(REFIID aIid) const
{
#if defined(MOZ_MSCOM_REMARSHAL_NO_HANDLER)
return IsCallerExternalProcess() ? aIid : mEventSink->MarshalAs(aIid);
#else
return mEventSink->MarshalAs(aIid);
#endif // defined(MOZ_MSCOM_REMARSHAL_NO_HANDLER)
}
HRESULT
Interceptor::GetUnmarshalClass(REFIID riid, void* pv, DWORD dwDestContext,
void* pvDestContext, DWORD mshlflags,
CLSID* pCid)
{
return mStdMarshal->GetUnmarshalClass(MarshalAs(riid), pv, dwDestContext,
pvDestContext, mshlflags, pCid);
return mStdMarshal->GetUnmarshalClass(riid, pv, dwDestContext, pvDestContext,
mshlflags, pCid);
}
HRESULT
@ -217,7 +207,7 @@ Interceptor::GetMarshalSizeMax(REFIID riid, void* pv, DWORD dwDestContext,
void* pvDestContext, DWORD mshlflags,
DWORD* pSize)
{
HRESULT hr = mStdMarshal->GetMarshalSizeMax(MarshalAs(riid), pv, dwDestContext,
HRESULT hr = mStdMarshal->GetMarshalSizeMax(riid, pv, dwDestContext,
pvDestContext, mshlflags, pSize);
if (FAILED(hr)) {
return hr;
@ -430,7 +420,7 @@ Interceptor::GetInitialInterceptorForIID(detail::LiveSetAutoLock& aLock,
unkInterceptor,
aTarget.release()));
if (MarshalAs(aTargetIid) == aTargetIid) {
if (mEventSink->MarshalAs(aTargetIid) == aTargetIid) {
return unkInterceptor->QueryInterface(aTargetIid, aOutInterceptor);
}
@ -459,7 +449,7 @@ Interceptor::GetInterceptorForIID(REFIID aIid, void** aOutInterceptor)
return S_OK;
}
REFIID interceptorIid = MarshalAs(aIid);
REFIID interceptorIid = mEventSink->MarshalAs(aIid);
RefPtr<IUnknown> unkInterceptor;
IUnknown* interfaceForQILog = nullptr;

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

@ -129,7 +129,6 @@ private:
HRESULT ThreadSafeQueryInterface(REFIID aIid,
IUnknown** aOutInterface) override;
HRESULT CreateInterceptor(REFIID aIid, IUnknown* aOuter, IUnknown** aOutput);
REFIID MarshalAs(REFIID aIid) const;
private:
InterceptorTargetPtr<IUnknown> mTarget;

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

@ -107,8 +107,8 @@ Handler::GetUnmarshalClass(REFIID riid, void* pv, DWORD dwDestContext,
void* pvDestContext, DWORD mshlflags,
CLSID* pCid)
{
return mUnmarshal->GetUnmarshalClass(MarshalAs(riid), pv, dwDestContext,
pvDestContext, mshlflags, pCid);
return mUnmarshal->GetUnmarshalClass(riid, pv, dwDestContext, pvDestContext,
mshlflags, pCid);
}
HRESULT
@ -187,9 +187,12 @@ Handler::MarshalInterface(IStream* pStm, REFIID riid, void* pv,
if (FAILED(hr)) {
return hr;
}
#endif // defined(MOZ_MSCOM_REMARSHAL_NO_HANDLER)
// When marshaling without a handler, we just use the riid as passed in.
REFIID marshalAs = riid;
#else
REFIID marshalAs = MarshalAs(riid);
#endif // defined(MOZ_MSCOM_REMARSHAL_NO_HANDLER)
hr = mInnerUnk->QueryInterface(marshalAs, getter_AddRefs(unkToMarshal));
if (FAILED(hr)) {