mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-13 20:14:57 -10:00
Bug 1821972 part 1: Remove/replace the few remaining ipc/mscom uses in a11y code. r=nlapre
Regarding LazyInstantiator::ResolveDispatch, we already had code in MsaaAccessible to get the IAccessible typelib. mscom::RegisterTypelib has a lot of dependencies and it doesn't make sense to keep it for this one use case we can already support another way. Differential Revision: https://phabricator.services.mozilla.com/D177966
This commit is contained in:
1 parent
dcbc842252
commit
1492008da4
3 files changed
+11
-21
No files matched your search
@@ -12,7 +12,6 @@
|
||||
#include "mozilla/a11y/Platform.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/mscom/ProcessRuntime.h"
|
||||
#include "mozilla/mscom/Registration.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "mozilla/WinHeaderOnlyUtils.h"
|
||||
#include "MsaaRootAccessible.h"
|
||||
@@ -449,25 +448,16 @@ LazyInstantiator::ResolveDispatch() {
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// The IAccessible typelib is embedded in oleacc.dll's resources.
|
||||
auto typelib = mscom::RegisterTypelib(
|
||||
L"oleacc.dll", mscom::RegistrationFlags::eUseSystemDirectory);
|
||||
if (!typelib) {
|
||||
// Extract IAccessible's type info
|
||||
RefPtr<ITypeInfo> accTypeInfo = MsaaAccessible::GetTI(LOCALE_USER_DEFAULT);
|
||||
if (!accTypeInfo) {
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
// Extract IAccessible's type info
|
||||
RefPtr<ITypeInfo> accTypeInfo;
|
||||
HRESULT hr =
|
||||
typelib->GetTypeInfoForGuid(IID_IAccessible, getter_AddRefs(accTypeInfo));
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Now create the standard IDispatch for IAccessible
|
||||
hr = ::CreateStdDispatch(static_cast<IAccessible*>(this),
|
||||
static_cast<IAccessible*>(this), accTypeInfo,
|
||||
getter_AddRefs(mStdDispatch));
|
||||
HRESULT hr = ::CreateStdDispatch(static_cast<IAccessible*>(this),
|
||||
static_cast<IAccessible*>(this), accTypeInfo,
|
||||
getter_AddRefs(mStdDispatch));
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#define mozilla_a11y_LazyInstantiator_h
|
||||
|
||||
#include "IUnknownImpl.h"
|
||||
#include "mozilla/mscom/Ptr.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "nsString.h"
|
||||
|
||||
|
||||
@@ -54,6 +54,11 @@ class MsaaAccessible : public ia2Accessible,
|
||||
|
||||
static MsaaAccessible* GetFrom(Accessible* aAcc);
|
||||
|
||||
/**
|
||||
* Creates ITypeInfo for LIBID_Accessibility if it's needed and returns it.
|
||||
*/
|
||||
static ITypeInfo* GetTI(LCID lcid);
|
||||
|
||||
DECL_IUNKNOWN
|
||||
|
||||
// IAccessible
|
||||
@@ -180,10 +185,6 @@ class MsaaAccessible : public ia2Accessible,
|
||||
};
|
||||
|
||||
private:
|
||||
/**
|
||||
* Creates ITypeInfo for LIBID_Accessibility if it's needed and returns it.
|
||||
*/
|
||||
static ITypeInfo* GetTI(LCID lcid);
|
||||
static ITypeInfo* gTypeInfo;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user