Comment on attachment 556542
gsettings proxy patch v 1
I looked at the GSettingsService changes.
There is a new symbol that needs to be added to the GSETTINGS_FUNCTIONS at the
top of the file for dynamic lookup, and some other things to touch up there so
that this compiles against old versions of GIO.
Would it make sense to instead use nsISupportsCString?
That would be more consistent with the AUTF8Strings returned by getString and
used in parameters, and it is probably the format more useful to the caller in
this case.
Comment on attachment 556542
gsettings proxy patch v 1
I looked at the GSettingsService changes.
There is a new symbol that needs to be added to the GSETTINGS_FUNCTIONS at the
top of the file for dynamic lookup, and some other things to touch up there so
that this compiles against old versions of GIO.
>+#include "nsISupports.h"
> #include "nsCOMPtr.h"
>+#include "nsIMutableArray.h"
I expect nsISupports.h does not need to be listed explicitly because itives. h will pull it in.
nsIMutableArray.h or nsISupportsPrim
>+ const gchar ** gs_strings = g_variant_ get_strv( value, NULL); unref(value) ;
>+ g_variant_
gs_strings doesn't own the strings, only the list of pointers.
What owns the strings after value is released?
>+ if (!gs_strings) {
>+ // empty array
>+ return NS_OK;
>+ }
aResult needs to be set if returning NS_OK.
>+ nsCOMPtr< nsIMutableArray > items(do_ CreateInstance( NS_ARRAY_ CONTRACTID) ); OUT_OF_ MEMORY;
>+ if (!items)
>+ return NS_ERROR_
Leaks gs_strings.
Probably tidiest to move this construction to before other allocations.
>+ nsCOMPtr< nsISupportsStri ng> obj(do_ CreateInstance( NS_SUPPORTS_ STRING_ CONTRACTID) );
Would it make sense to instead use nsISupportsCString?
That would be more consistent with the AUTF8Strings returned by getString and
used in parameters, and it is probably the format more useful to the caller in
this case.
Think about whether using NS_NewAdoptingU TF8StringEnumer ator instead of hg.mozilla. org/mozilla- central/ annotate/ 84117219ded0/ xpcom/ds/ nsStringEnumera tor.h#l90
nsIMutableArray would simplify things:
http://