Closed Bug 1124285 Opened 9 years ago Closed 9 years ago

set up wrappers for proxies on windows

Categories

(Core :: Disability Access APIs, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38

People

(Reporter: tbsaunde, Assigned: tbsaunde)

Details

Attachments

(1 file)

      No description provided.
Unfortunately on windows there's no separate object implementing the
native interfaces.  That means we need to have a type of accessible that
just wraps a proxy.
Attachment #8552568 - Flags: review?(dbolter)
Comment on attachment 8552568 [details] [diff] [review]
setup proxies on windows

Review of attachment 8552568 [details] [diff] [review]:
-----------------------------------------------------------------

::: accessible/base/AccTypes.h
@@ +51,5 @@
>    eApplicationType,
>    eHTMLOptGroupType,
>    eImageMapType,
>    eMenuPopupType,
> +  eProxyType,

(I wondered if maybe we could just check mBits.proxy in IsProxy() but this is fine)

::: accessible/windows/msaa/AccessibleWrap.cpp
@@ +80,5 @@
>  
>    *ppv = nullptr;
>  
> +  if (IID_IUnknown == iid)
> +    *ppv = static_cast<IAccessible*>(this);

Why do we need to separate this check and have it before the IsProxy check?

@@ +85,5 @@
> +
> +  if (!*ppv && IsProxy())
> +    return E_NOINTERFACE;
> +
> +    if (IID_IDispatch == iid || IID_IAccessible == iid)

nit: remove two spaces off this indent
> ::: accessible/base/AccTypes.h
> @@ +51,5 @@
> >    eApplicationType,
> >    eHTMLOptGroupType,
> >    eImageMapType,
> >    eMenuPopupType,
> > +  eProxyType,
> 
> (I wondered if maybe we could just check mBits.proxy in IsProxy() but this
> is fine)

no, because if the union is storing a group info you'll just read out a garbage pointer.

> ::: accessible/windows/msaa/AccessibleWrap.cpp
> @@ +80,5 @@
> >  
> >    *ppv = nullptr;
> >  
> > +  if (IID_IUnknown == iid)
> > +    *ppv = static_cast<IAccessible*>(this);
> 
> Why do we need to separate this check and have it before the IsProxy check?

I'm just trying to have a setup were we can enable QIing proxy wrappers to some interfaces we know can deal with that case, but not the others.  Currently if you call IAccessibleHypertext::get_text() say on a accessible holding a proxy you'll just get a strnage crash.
Comment on attachment 8552568 [details] [diff] [review]
setup proxies on windows

Review of attachment 8552568 [details] [diff] [review]:
-----------------------------------------------------------------

r=me, just the format nit left.

(In reply to Trevor Saunders (:tbsaunde) from comment #3)
> > ::: accessible/base/AccTypes.h
> > @@ +51,5 @@
> > >    eApplicationType,
> > >    eHTMLOptGroupType,
> > >    eImageMapType,
> > >    eMenuPopupType,
> > > +  eProxyType,
> > 
> > (I wondered if maybe we could just check mBits.proxy in IsProxy() but this
> > is fine)
> 
> no, because if the union is storing a group info you'll just read out a
> garbage pointer.

Ah right union not struct ok.

> > ::: accessible/windows/msaa/AccessibleWrap.cpp
> > @@ +80,5 @@
> > >  
> > >    *ppv = nullptr;
> > >  
> > > +  if (IID_IUnknown == iid)
> > > +    *ppv = static_cast<IAccessible*>(this);
> > 
> > Why do we need to separate this check and have it before the IsProxy check?
> 
> I'm just trying to have a setup were we can enable QIing proxy wrappers to
> some interfaces we know can deal with that case, but not the others. 
> Currently if you call IAccessibleHypertext::get_text() say on a accessible
> holding a proxy you'll just get a strnage crash.

OK thanks.
Attachment #8552568 - Flags: review?(dbolter) → review+
https://hg.mozilla.org/mozilla-central/rev/c1237502c5e2
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Assignee: nobody → tbsaunde+mozbugs
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: