Closed Bug 545738 Opened 10 years ago Closed 10 years ago

clean up nsAccessibilityService::GetAccessible() and related

Categories

(Core :: Disability Access APIs, defect)

defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: surkov, Assigned: surkov)

References

(Blocks 1 open bug)

Details

(Keywords: access)

Attachments

(1 file)

No description provided.
Attached patch patchSplinter Review
Assignee: nobody → surkov.alexander
Status: NEW → ASSIGNED
Attachment #426657 - Flags: review?(bolterbugz)
Comment on attachment 426657 [details] [diff] [review]
patch

I probably need coffee but:

>+already_AddRefed<nsAccessible>
>+nsAccessibilityService::CreateAccessibleForDeckChild(nsIFrame* aFrame,
>+                                                     nsIDOMNode *aNode,
>+                                                     nsIWeakReference *aWeakShell)
> {

>-  return NS_OK;
>+  return accessible.forget();
> }

This doesn't look safe since we haven't addrefed the accessible. You do this in several places...
Attachment #426657 - Flags: review?(bolterbugz)
(In reply to comment #3)
> (From update of attachment 426657 [details] [diff] [review])
> I probably need coffee but:

yep, please :)

> >+already_AddRefed<nsAccessible>
> >+nsAccessibilityService::CreateAccessibleForDeckChild(nsIFrame* aFrame,
> >+                                                     nsIDOMNode *aNode,
> >+                                                     nsIWeakReference *aWeakShell)
> > {
> 
> >-  return NS_OK;
> >+  return accessible.forget();
> > }
> 
> This doesn't look safe since we haven't addrefed the accessible. You do this in
> several places...

forget() forgets the pointer and returns already_AddRefed
Ah right the caller is using a smart pointer.
landed on 1.9.3 - http://hg.mozilla.org/mozilla-central/rev/acab380e4de3
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.