зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1374792: Modify a11y handler to only invoke IGeckoBackChannel::put_HandlerControl once; r=eeejay
MozReview-Commit-ID: Bxo0IsAuhBh
This commit is contained in:
Родитель
8bd02d75b7
Коммит
44e203215a
|
@ -222,17 +222,12 @@ AccessibleHandler::ReadHandlerPayload(IStream* aStream, REFIID aIid)
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
long pid = static_cast<long>(::GetCurrentProcessId());
|
RefPtr<AccessibleHandlerControl> ctl(gControlFactory.GetOrCreateSingleton());
|
||||||
|
if (!ctl) {
|
||||||
RefPtr<IHandlerControl> ctl;
|
return E_OUTOFMEMORY;
|
||||||
HRESULT hr = gControlFactory.CreateInstance(nullptr, IID_IHandlerControl,
|
|
||||||
getter_AddRefs(ctl));
|
|
||||||
if (SUCCEEDED(hr)) {
|
|
||||||
hr = mCachedData.mGeckoBackChannel->put_HandlerControl(pid, ctl);
|
|
||||||
MOZ_ASSERT(SUCCEEDED(hr));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return hr;
|
return ctl->Register(WrapNotNull(mCachedData.mGeckoBackChannel));
|
||||||
}
|
}
|
||||||
|
|
||||||
REFIID
|
REFIID
|
||||||
|
|
|
@ -132,7 +132,8 @@ AccessibleHandlerControl::Create(AccessibleHandlerControl** aOutObject)
|
||||||
}
|
}
|
||||||
|
|
||||||
AccessibleHandlerControl::AccessibleHandlerControl()
|
AccessibleHandlerControl::AccessibleHandlerControl()
|
||||||
: mCacheGen(0)
|
: mIsRegistered(false)
|
||||||
|
, mCacheGen(0)
|
||||||
, mIA2Proxy(mscom::RegisterProxy(L"ia2marshal.dll"))
|
, mIA2Proxy(mscom::RegisterProxy(L"ia2marshal.dll"))
|
||||||
, mHandlerProxy(mscom::RegisterProxy())
|
, mHandlerProxy(mscom::RegisterProxy())
|
||||||
{
|
{
|
||||||
|
@ -189,5 +190,19 @@ AccessibleHandlerControl::GetHandlerTypeInfo(ITypeInfo** aOutTypeInfo)
|
||||||
aOutTypeInfo);
|
aOutTypeInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HRESULT
|
||||||
|
AccessibleHandlerControl::Register(NotNull<IGeckoBackChannel*> aGecko)
|
||||||
|
{
|
||||||
|
if (mIsRegistered) {
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
long pid = static_cast<long>(::GetCurrentProcessId());
|
||||||
|
HRESULT hr = aGecko->put_HandlerControl(pid, this);
|
||||||
|
mIsRegistered = SUCCEEDED(hr);
|
||||||
|
MOZ_ASSERT(mIsRegistered);
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace a11y
|
} // namespace a11y
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
|
@ -71,10 +71,13 @@ public:
|
||||||
|
|
||||||
HRESULT GetHandlerTypeInfo(ITypeInfo** aOutTypeInfo);
|
HRESULT GetHandlerTypeInfo(ITypeInfo** aOutTypeInfo);
|
||||||
|
|
||||||
|
HRESULT Register(NotNull<IGeckoBackChannel*> aGecko);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AccessibleHandlerControl();
|
AccessibleHandlerControl();
|
||||||
~AccessibleHandlerControl() = default;
|
~AccessibleHandlerControl() = default;
|
||||||
|
|
||||||
|
bool mIsRegistered;
|
||||||
uint32_t mCacheGen;
|
uint32_t mCacheGen;
|
||||||
detail::TextChange mTextChange;
|
detail::TextChange mTextChange;
|
||||||
UniquePtr<mscom::RegisteredProxy> mIA2Proxy;
|
UniquePtr<mscom::RegisteredProxy> mIA2Proxy;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче