Bug 55107 - GVariant-based Handler_Info
Summary: GVariant-based Handler_Info
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: unspecified
Hardware: Other All
: low enhancement
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks: 30422
  Show dependency treegraph
 
Reported: 2012-09-19 15:21 UTC by Simon McVittie
Modified: 2014-03-03 10:03 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
handle-channel-context: replace get_handler_info by a GVariant version (4.76 KB, patch)
2014-02-28 12:34 UTC, Guillaume Desmottes
Details | Splinter Review
test tp_handle_channel_context_dup_handler_info() (1.33 KB, patch)
2014-02-28 12:34 UTC, Guillaume Desmottes
Details | Splinter Review
handle-channel-context: store handler_info as a GVariant (5.02 KB, patch)
2014-02-28 12:34 UTC, Guillaume Desmottes
Details | Splinter Review

Description Simon McVittie 2012-09-19 15:21:42 UTC
+++ This bug was initially created as a clone of Bug #30422 +++

tp_handle_channels_context_get_handler_info returns a dbus-glib GHashTable. We should have a version that returns a new ref to a G_VARIANT_TYPE_VARDICT.
Comment 1 Guillaume Desmottes 2014-02-28 12:34:11 UTC
Created attachment 94880 [details] [review]
handle-channel-context: replace get_handler_info by a GVariant version
Comment 2 Guillaume Desmottes 2014-02-28 12:34:25 UTC
Created attachment 94881 [details] [review]
test tp_handle_channel_context_dup_handler_info()
Comment 3 Guillaume Desmottes 2014-02-28 12:34:44 UTC
Created attachment 94882 [details] [review]
handle-channel-context: store handler_info as a GVariant
Comment 4 Simon McVittie 2014-02-28 13:05:54 UTC
Comment on attachment 94880 [details] [review]
handle-channel-context: replace get_handler_info by a GVariant version

Review of attachment 94880 [details] [review]:
-----------------------------------------------------------------

::: telepathy-glib/handle-channel-context.c
@@ +690,3 @@
>  {
>    g_return_val_if_fail (TP_IS_HANDLE_CHANNELS_CONTEXT (self), NULL);
> +  return tp_asv_to_vardict (self->handler_info);

Contrary to Bug #55109, this relies for its correctness on tp_asv_to_vardict *not* returning a floating ref. Pick one :-)
Comment 5 Simon McVittie 2014-02-28 13:06:40 UTC
Comment on attachment 94881 [details] [review]
test tp_handle_channel_context_dup_handler_info()

Review of attachment 94881 [details] [review]:
-----------------------------------------------------------------

++
Comment 6 Guillaume Desmottes 2014-02-28 14:27:42 UTC
(In reply to comment #4)
> Comment on attachment 94880 [details] [review] [review]
> handle-channel-context: replace get_handler_info by a GVariant version
> 
> Review of attachment 94880 [details] [review] [review]:
> -----------------------------------------------------------------
> 
> ::: telepathy-glib/handle-channel-context.c
> @@ +690,3 @@
> >  {
> >    g_return_val_if_fail (TP_IS_HANDLE_CHANNELS_CONTEXT (self), NULL);
> > +  return tp_asv_to_vardict (self->handler_info);
> 
> Contrary to Bug #55109, this relies for its correctness on tp_asv_to_vardict
> *not* returning a floating ref. Pick one :-)

I rebased the branch on top of next where tp_asv_to_vardict() now returns a floating ref so it's now ok.
Comment 7 Simon McVittie 2014-02-28 16:03:07 UTC
(In reply to comment #6)
> > Contrary to Bug #55109, this relies for its correctness on tp_asv_to_vardict
> > *not* returning a floating ref. Pick one :-)
> 
> I rebased the branch on top of next where tp_asv_to_vardict() now returns a
> floating ref so it's now ok.

If this is now g_variant_ref_sink (tp_asv_to_vardict (self->handler_info)), ship it. Otherwise, no.
Comment 8 Guillaume Desmottes 2014-03-03 10:03:45 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > > Contrary to Bug #55109, this relies for its correctness on tp_asv_to_vardict
> > > *not* returning a floating ref. Pick one :-)
> > 
> > I rebased the branch on top of next where tp_asv_to_vardict() now returns a
> > floating ref so it's now ok.
> 
> If this is now g_variant_ref_sink (tp_asv_to_vardict (self->handler_info)),
> ship it. Otherwise, no.

It is; merged.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.