bug 1196460 - create different proxy wrappers depending on the type of the proxy r=surkov

This commit is contained in:
Trevor Saunders 2015-08-07 16:27:34 -04:00
parent acd026c4d6
commit 38a420fd55

View File

@ -35,9 +35,17 @@ a11y::PlatformShutdown()
}
void
a11y::ProxyCreated(ProxyAccessible* aProxy, uint32_t)
a11y::ProxyCreated(ProxyAccessible* aProxy, uint32_t aInterfaces)
{
ProxyAccessibleWrap* wrapper = new ProxyAccessibleWrap(aProxy);
AccessibleWrap* wrapper = nullptr;
if (aInterfaces & Interfaces::DOCUMENT) {
wrapper = new DocProxyAccessibleWrap(aProxy);
} else if (aInterfaces & Interfaces::HYPERTEXT) {
wrapper = new HyperTextProxyAccessibleWrap(aProxy);
} else {
wrapper = new ProxyAccessibleWrap(aProxy);
}
wrapper->AddRef();
aProxy->SetWrapper(reinterpret_cast<uintptr_t>(wrapper));
}
@ -45,8 +53,8 @@ a11y::ProxyCreated(ProxyAccessible* aProxy, uint32_t)
void
a11y::ProxyDestroyed(ProxyAccessible* aProxy)
{
ProxyAccessibleWrap* wrapper =
reinterpret_cast<ProxyAccessibleWrap*>(aProxy->GetWrapper());
AccessibleWrap* wrapper =
reinterpret_cast<AccessibleWrap*>(aProxy->GetWrapper());
MOZ_ASSERT(wrapper);
if (!wrapper)
return;