Last Comment Bug 756973 - make RootAccessible::NativeState faster
: make RootAccessible::NativeState faster
Status: RESOLVED FIXED
: access
Product: Core
Classification: Components
Component: Disability Access APIs (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla15
Assigned To: alexander :surkov
:
:
Mentors:
Depends on:
Blocks: 732872
  Show dependency treegraph
 
Reported: 2012-05-21 00:48 PDT by alexander :surkov
Modified: 2012-05-23 04:56 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (2.56 KB, patch)
2012-05-21 00:48 PDT, alexander :surkov
tbsaunde+mozbugs: review+
enndeakin: review+
Details | Diff | Splinter Review

Description alexander :surkov 2012-05-21 00:48:00 PDT
Created attachment 625571 [details] [diff] [review]
patch
Comment 1 Trevor Saunders (:tbsaunde) 2012-05-21 14:20:53 PDT
Comment on attachment 625571 [details] [diff] [review]
patch

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

what's it for?
Comment 2 alexander :surkov 2012-05-22 03:09:33 PDT
(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.
Comment 3 Trevor Saunders (:tbsaunde) 2012-05-22 07:22:17 PDT
(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.
Comment 4 David Bolter [:davidb] 2012-05-22 07:31:20 PDT
(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.
Comment 5 David Bolter [:davidb] 2012-05-22 07:31:51 PDT
Which probably happens nearly all the time?
Comment 6 Trevor Saunders (:tbsaunde) 2012-05-22 07:39:55 PDT
(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
Comment 7 Trevor Saunders (:tbsaunde) 2012-05-22 07:42:35 PDT
(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()
Comment 8 David Bolter [:davidb] 2012-05-22 07:46:31 PDT
(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).
Comment 10 Ed Morley [:emorley] 2012-05-23 04:56:04 PDT
https://hg.mozilla.org/mozilla-central/rev/fb5b2c7e1b9b

Note You need to log in before you can comment on or make changes to this bug.