Closed Bug 461920 Opened 16 years ago Closed 16 years ago

remove nsPIAccessNode

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: surkov, Assigned: surkov)

References

Details

Attachments

(1 file, 2 obsolete files)

      No description provided.
Attached patch patch (obsolete) — Splinter Review
is there a nice way to query from nsCOMPtr to nsRefPtr?
Assignee: nobody → surkov.alexander
Status: NEW → ASSIGNED
Attachment #345294 - Flags: superreview?(neil)
Attachment #345294 - Flags: review?(aaronleventhal)
While looking for one I found a leak in nsAccessible::GetAttributesInternal

nsCOMPtr<nsISupports> container = doc->GetContainer();
nsIDocShellTreeItem *docShellTreeItem = nsnull;
if (container)
  CallQueryInterface(container, &docShellTreeItem);

docShellTreeItem is never released. Correct coding here is:

nsCOMPtr<nsIDocShellTreeItem>
    docShellTreeItem(do_QueryInterface(doc->GetContainer()));

The common pattern seems to be to use a helper function:

already_AddRefed<nsAccessNode> GetAccessNode(nsIAccessSomething* aAccessible)
{
  nsAccessNode* accessNode = nsnull;
  if (aAccessible)
    CallQueryInterface(aAccessible, &accessNode);
  return accessNode;
}

Then you can use

nsRefPtr<nsAccessNode> accessNode = GetAccessNode(aAccessible);
Comment on attachment 345294 [details] [diff] [review]
patch

Waiting for new patch.
Attachment #345294 - Flags: review?(aaronleventhal)
Attached patch patch2 (obsolete) — Splinter Review
with neil's comments
Attachment #345294 - Attachment is obsolete: true
Attachment #345425 - Flags: superreview?(neil)
Attachment #345425 - Flags: review?(aaronleventhal)
Attachment #345294 - Flags: superreview?(neil)
Comment on attachment 345425 [details] [diff] [review]
patch2

Marco, can you test this patch in real work?
Attachment #345425 - Flags: review?(marco.zehe)
Attached patch patch3Splinter Review
Attachment #345425 - Attachment is obsolete: true
Attachment #345429 - Flags: superreview?(neil)
Attachment #345429 - Flags: review?(aaronleventhal)
Attachment #345425 - Flags: superreview?(neil)
Attachment #345425 - Flags: review?(marco.zehe)
Attachment #345425 - Flags: review?(aaronleventhal)
Attachment #345429 - Flags: review?(marco.zehe)
So far no negative impact in the three supporting screen readers on Windows. Both web pages and XUL dialogs work as they did before.
Comment on attachment 345429 [details] [diff] [review]
patch3

All's fine on Linux as well. From a functionality standpoint, this is fine. Thanks!
Attachment #345429 - Flags: review?(marco.zehe) → review+
Attachment #345429 - Flags: review?(aaronleventhal) → review+
Comment on attachment 345429 [details] [diff] [review]
patch3

>-NS_IMPL_ISUPPORTS_INHERITED2(nsTextAccessible, nsAccessNode, nsIAccessible, nsPIAccessible)
>+NS_IMPL_ISUPPORTS_INHERITED3(nsTextAccessible, nsAccessNode,
>+                             nsAccessible, nsIAccessible, nsPIAccessible)
This looks like a fix left over from another patch ;-)
Attachment #345429 - Flags: superreview?(neil) → superreview+
(In reply to comment #10)
> (From update of attachment 345429 [details] [diff] [review])
> >-NS_IMPL_ISUPPORTS_INHERITED2(nsTextAccessible, nsAccessNode, nsIAccessible, nsPIAccessible)
> >+NS_IMPL_ISUPPORTS_INHERITED3(nsTextAccessible, nsAccessNode,
> >+                             nsAccessible, nsIAccessible, nsPIAccessible)
> This looks like a fix left over from another patch ;-)

No actually. You could argue it's another bug (because generally we don't deal here with nsAccessible) but I included it because this patch without this fix makes crash firefox.
http://hg.mozilla.org/mozilla-central/rev/7684dee590b9
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: