Comment 14 for bug 857153

Revision history for this message
In , Mgorse (mgorse) wrote :

(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #5)

> > + const char *iface = "org.a11y.Status";
> > + const char *member = "IsEnabled";
>
> static const char iface[] = ...;
> static const char member[] = ...;

If I do this, then I get a seg fault, whether I preface the reference with & or not. I need a char ** to pass to dbus_message_append_args.

> @@ +636,5 @@
> > + goto exit;
> > +
> > + message = dbus_message_new_method_call ("org.a11y.Bus", "/org/a11y/bus",
> > + "org.freedesktop.DBus.Properties",
> > + "Get");
>
> How fast is this? We're calling this on every widget creation, could this be
> slow?

On my laptop (2.4ghz Core 2 Duo), it takes 0.6ms for the call plus an additional millisecond the first time a connection to the session bus is established. I presume it would take longer on a slower machine. The current code in widget/src/gtk2 records the result in a static variable, so there it would only make the call once, but, regardless, I agree that it is better to only have the code in one place if possible, so I'm testing with the duplicate code removed.