Closed Bug 756973 Opened 12 years ago Closed 12 years ago

make RootAccessible::NativeState faster

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: surkov, Assigned: surkov)

References

Details

(Keywords: access)

Attachments

(1 file)

Attached patch patchSplinter Review
      No description provided.
Attachment #625571 - Flags: review?(trev.saunders)
Attachment #625571 - Flags: review?(enndeakin)
Blocks: 732872
Comment on attachment 625571 [details] [diff] [review]
patch

>+  PRUint64 state = nsDocAccessibleWrap::NativeState();
>+  if (state & states::DEFUNCT)
>+    return state;

what's it for?
Attachment #625571 - Flags: review?(trev.saunders) → review+
(In reply to Trevor Saunders (:tbsaunde) from comment #1)
> Comment on attachment 625571 [details] [diff] [review]
> patch
> 
> >+  PRUint64 state = nsDocAccessibleWrap::NativeState();
> >+  if (state & states::DEFUNCT)
> >+    return state;
> 
> what's it for?

basically to not have a check for mDocument, in general I think we are allowed to not spend a time for states computation if accessible is defunct.
(In reply to alexander :surkov from comment #2)
> (In reply to Trevor Saunders (:tbsaunde) from comment #1)
> > Comment on attachment 625571 [details] [diff] [review]
> > patch
> > 
> > >+  PRUint64 state = nsDocAccessibleWrap::NativeState();
> > >+  if (state & states::DEFUNCT)
> > >+    return state;
> > 
> > what's it for?
> 
> basically to not have a check for mDocument, in general I think we are
> allowed to not spend a time for states computation if accessible is defunct.

yeah, was just wondering why it was possible we were dealing with a defunct accessible since I forgot about the atk crash.
(In reply to Trevor Saunders (:tbsaunde) from comment #3)
> (In reply to alexander :surkov from comment #2)
> > (In reply to Trevor Saunders (:tbsaunde) from comment #1)
> > > Comment on attachment 625571 [details] [diff] [review]
> > > patch
> > > 
> > > >+  PRUint64 state = nsDocAccessibleWrap::NativeState();
> > > >+  if (state & states::DEFUNCT)
> > > >+    return state;
> > > 
> > > what's it for?
> > 
> > basically to not have a check for mDocument, in general I think we are
> > allowed to not spend a time for states computation if accessible is defunct.
> 
> yeah, was just wondering why it was possible we were dealing with a defunct
> accessible since I forgot about the atk crash.

It might be cleaner to only return states::DEFUNCT here.
Which probably happens nearly all the time?
(In reply to David Bolter [:davidb] from comment #5)
> Which probably happens nearly all the time?

what? being called on a defunct accessible? hopefully not
(In reply to alexander :surkov from comment #2)
> (In reply to Trevor Saunders (:tbsaunde) from comment #1)
> > Comment on attachment 625571 [details] [diff] [review]
> > patch
> > 
> > >+  PRUint64 state = nsDocAccessibleWrap::NativeState();
> > >+  if (state & states::DEFUNCT)
> > >+    return state;
> > 
> > what's it for?
> 
> basically to not have a check for mDocument, in general I think we are
> allowed to not spend a time for states computation if accessible is defunct.

actually, I'm not sure how it works either, since we only set  the DEFUNCT state in nsAccessible::NativeState()
(In reply to Trevor Saunders (:tbsaunde) from comment #6)
> (In reply to David Bolter [:davidb] from comment #5)
> > Which probably happens nearly all the time?
> 
> what? being called on a defunct accessible?

No. I'm wondering how often is returning "state" equivalent to returning states::DEFUNCT (how often are other bits flipped).
Attachment #625571 - Flags: review?(enndeakin) → review+
Assignee: nobody → surkov.alexander
https://hg.mozilla.org/mozilla-central/rev/fb5b2c7e1b9b
Status: NEW → RESOLVED
Closed: 12 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: