Closed Bug 1172053 Opened 9 years ago Closed 9 years ago

use malloc a little less when dispatching atk events

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: tbsaunde, Assigned: tbsaunde)

Details

Attachments

(3 files)

      No description provided.
Comment on attachment 8616094 [details] [diff] [review]
don't call malloc in FireAtkShowHideEvent

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

::: accessible/atk/AccessibleWrap.cpp
@@ +1504,5 @@
>      AtkObject *parentObject = getParentCB(aObject);
>      NS_ENSURE_STATE(parentObject);
>  
>      bool isFromUserInput = aEvent->IsFromUserInput();
> +    const char *signal_name = kMutationStrings[!!isFromUserInput][!aIsAdded];

The double negation here isn't necessary, bools are guaranteed to be converted to 0/1.
Attachment #8616094 - Flags: review?(lorien) → review+
Comment on attachment 8616096 [details] [diff] [review]
don't malloc the signal name in FireAtkTextChangedEvent

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

Also, just noticed this, but if you wanted to be consistent in the order of the user and system arrays, they're in the opposite order in the other patch.

::: accessible/atk/AccessibleWrap.cpp
@@ +1485,5 @@
>      // XXX remove this code and the gHaveNewTextSignals check when we can
>      // stop supporting old atk since it doesn't really work anyway
>      // see bug 619002
> +    const char* signal_name =
> +      oldTextChangeStrings[!!isFromUserInput][!!isInserted];

double negation isn't needed here

@@ +1491,5 @@
>    } else {
>      nsAutoString text;
>      event->GetModifiedText(text);
> +    const char* signal_name =
> +      textChangedStrings[!!isFromUserInput][!!isInserted];

same
Attachment #8616096 - Flags: review?(lorien) → review+
Attachment #8620412 - Flags: review?(lorien) → review+
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: