Debian Codegraph @

src/xdp-session.c

raw symbols SCIP
1 /*
2 * Copyright © 2017 Red Hat, Inc
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21 #include "config.h"cxx . . $ `<file>/build/config.h`/
22
23 #include "xdp-session.h"cxx . . $ `<file>/src/xdp-session.h`/
24
25 #include <string.h>
26
27 #include "xdp-context.h"cxx . . $ `<file>/src/xdp-context.h`/
28 #include "xdp-request.h"cxx . . $ `<file>/src/xdp-request.h`/
29
30 typedef enumcxx . . $ $anonymous_type_e2690c1d1a1ab12e_0#
31 {
32 PROP_CONTEXTcxx . . $ PROP_CONTEXT. = 1,
33 PROP_SENDERcxx . . $ PROP_SENDER.,
34 PROP_APP_IDcxx . . $ PROP_APP_ID.,
35 PROP_TOKENcxx . . $ PROP_TOKEN.,
36 PROP_CONNECTIONcxx . . $ PROP_CONNECTION.,
37 PROP_IMPL_CONNECTIONcxx . . $ PROP_IMPL_CONNECTION.,
38 PROP_IMPL_DBUS_NAMEcxx . . $ PROP_IMPL_DBUS_NAME.,
39 } XdpSessionPropscxx . . $ XdpSessionProps#;
40
41 static GParamSpeccxx . . $ GParamSpec# *obj_propscxx . . $ obj_props.[PROP_IMPL_DBUS_NAMEcxx . . $ PROP_IMPL_DBUS_NAME. + 1];
42
43 G_LOCK_DEFINEcxx . . $ `<external>/457917468643292165/gthread.h:113:9`! (sessions);
44 static GHashTablecxx . . $ GHashTable# *sessionscxx . . $ sessions.;
45
46 static void g_initable_iface_initcxx . . $ g_initable_iface_init(d44eb3c02fde4f8c). (GInitableIfacecxx . . $ GInitableIface# *iface);
47 static void xdp_session_skeleton_iface_initcxx . . $ xdp_session_skeleton_iface_init(858f9834dfa5697a). (XdpDbusSessionIfacecxx . . $ XdpDbusSessionIface# *iface);
48
49 G_DEFINE_TYPE_WITH_CODEcxx . . $ `<external>/9567554376676449156/gtype.h:1850:9`! (XdpSession, xdp_session, XDP_DBUS_TYPE_SESSION_SKELETONcxx . . $ `build/src/xdp-dbus.h:7849:9`!,
50 G_IMPLEMENT_INTERFACEcxx . . $ `<external>/9567554376676449156/gtype.h:2115:9`! (G_TYPE_INITABLEcxx . . $ `<external>/8486287435340430869/ginitable.h:34:9`!,
51 g_initable_iface_init)
52 G_IMPLEMENT_INTERFACEcxx . . $ `<external>/9567554376676449156/gtype.h:2115:9`! (XDP_DBUS_TYPE_SESSIONcxx . . $ `build/src/xdp-dbus.h:7702:9`!,
53 xdp_session_skeleton_iface_init));
54
55 #define XDP_SESSION_GET_CLASScxx . . $ `src/xdp-session.c:55:9`!(o) \
56 (G_TYPE_INSTANCE_GET_CLASScxx . . $ `<external>/9567554376676449156/gtype.h:571:9`! ((o), xdp_session_get_type (), XdpSessionClass))
57
58 const char *
59 lookup_session_tokencxx . . $ lookup_session_token(d2704f6d4d26effc). (GVariantcxx . . $ GVariant# *options)
60 {
61 const char *token = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
62
63 g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (options, "session_handle_token", "&s", &token);
64
65 return token;
66 }
67
68 XdpSessioncxx . . $ XdpSession# *
69 xdp_session_from_requestcxx . . $ xdp_session_from_request(b20d0b7552200bd). (const char *session_handle,
70 XdpRequestcxx . . $ XdpRequest# *request)
71 {
72 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpSession) session = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
73
74 G_LOCKcxx . . $ `<external>/457917468643292165/gthread.h:137:11`! (sessions);
75 session = g_hash_table_lookupcxx . . $ g_hash_table_lookup(8183d62c39a6a245). (sessionscxx . . $ sessions., session_handle);
76 if (session)
77 g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (session);
78 G_UNLOCKcxx . . $ `<external>/457917468643292165/gthread.h:138:11`! (sessions);
79
80 if (!session)
81 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
82
83 if (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (session->sendercxx . . $ _XdpSession#sender., request->sendercxx . . $ _XdpRequest#sender.) != 0)
84 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
85
86 if (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (session->app_idcxx . . $ _XdpSession#app_id., xdp_app_info_get_idcxx . . $ xdp_app_info_get_id(b9a768ac644c9329). (request->app_infocxx . . $ _XdpRequest#app_info.)) != 0)
87 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
88
89 return g_steal_pointercxx . . $ `<external>/1123956534522462559/gmem.h:250:9`! (&session);
90 }
91
92 XdpSessioncxx . . $ XdpSession# *
93 xdp_session_from_app_infocxx . . $ xdp_session_from_app_info(8bac21a832d9196). (const char *session_handle,
94 XdpAppInfocxx . . $ XdpAppInfo# *app_info)
95 {
96 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpSession) session = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
97
98 G_LOCKcxx . . $ `<external>/457917468643292165/gthread.h:137:11`! (sessions);
99 session = g_hash_table_lookupcxx . . $ g_hash_table_lookup(8183d62c39a6a245). (sessionscxx . . $ sessions., session_handle);
100 if (session)
101 g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (session);
102 G_UNLOCKcxx . . $ `<external>/457917468643292165/gthread.h:138:11`! (sessions);
103
104 if (!session)
105 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
106
107 if (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (session->sendercxx . . $ _XdpSession#sender., xdp_app_info_get_sendercxx . . $ xdp_app_info_get_sender(b9a768ac644c9329). (app_info)) != 0)
108 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
109
110 if (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (session->app_idcxx . . $ _XdpSession#app_id., xdp_app_info_get_idcxx . . $ xdp_app_info_get_id(b9a768ac644c9329). (app_info)) != 0)
111 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
112
113 return g_steal_pointercxx . . $ `<external>/1123956534522462559/gmem.h:250:9`! (&session);
114 }
115
116 XdpSessioncxx . . $ XdpSession# *
117 xdp_session_lookupcxx . . $ xdp_session_lookup(7cb6de4f3c42cd2). (const char *session_handle)
118 {
119 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpSession) session = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
120
121 G_LOCKcxx . . $ `<external>/457917468643292165/gthread.h:137:11`! (sessions);
122 session = g_hash_table_lookupcxx . . $ g_hash_table_lookup(8183d62c39a6a245). (sessionscxx . . $ sessions., session_handle);
123 if (session)
124 g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (session);
125 G_UNLOCKcxx . . $ `<external>/457917468643292165/gthread.h:138:11`! (sessions);
126
127 return g_steal_pointercxx . . $ `<external>/1123956534522462559/gmem.h:250:9`! (&session);
128 }
129
130 gbooleancxx . . $ gboolean#
131 xdp_session_exportcxx . . $ xdp_session_export(3c2cf3f1073dc4c7). (XdpSessioncxx . . $ XdpSession# *session,
132 GErrorcxx . . $ GError# **error)
133 {
134 if (!g_dbus_interface_skeleton_exportcxx . . $ g_dbus_interface_skeleton_export(b7cdb5e81947cba7). (G_DBUS_INTERFACE_SKELETONcxx . . $ `<external>/1991948168568871819/gdbusinterfaceskeleton.h:32:9`! (session),
135 session->connectioncxx . . $ _XdpSession#connection.,
136 session->idcxx . . $ _XdpSession#id.,
137 error))
138 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
139
140 g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (session);
141 session->exportedcxx . . $ _XdpSession#exported. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
142
143 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
144 }
145
146 static void
147 xdp_session_unexportcxx . . $ xdp_session_unexport(ac695378ab375fe8). (XdpSessioncxx . . $ XdpSession# *session)
148 {
149 session->exportedcxx . . $ _XdpSession#exported. = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
150 g_dbus_interface_skeleton_unexportcxx . . $ g_dbus_interface_skeleton_unexport(ea7137ee396aca18). (G_DBUS_INTERFACE_SKELETONcxx . . $ `<external>/1991948168568871819/gdbusinterfaceskeleton.h:32:9`! (session));
151 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (session);
152 }
153
154 void
155 xdp_session_registercxx . . $ xdp_session_register(ac695378ab375fe8). (XdpSessioncxx . . $ XdpSession# *session)
156 {
157 G_LOCKcxx . . $ `<external>/457917468643292165/gthread.h:137:11`! (sessions);
158 g_hash_table_insertcxx . . $ g_hash_table_insert(6a7c46015dd5ef26). (sessionscxx . . $ sessions., session->idcxx . . $ _XdpSession#id., session);
159 G_UNLOCKcxx . . $ `<external>/457917468643292165/gthread.h:138:11`! (sessions);
160 }
161
162 static void
163 xdp_session_unregistercxx . . $ xdp_session_unregister(ac695378ab375fe8). (XdpSessioncxx . . $ XdpSession# *session)
164 {
165 G_LOCKcxx . . $ `<external>/457917468643292165/gthread.h:137:11`! (sessions);
166 g_hash_table_removecxx . . $ g_hash_table_remove(453ebbf4abdbe50e). (sessionscxx . . $ sessions., session->idcxx . . $ _XdpSession#id.);
167 G_UNLOCKcxx . . $ `<external>/457917468643292165/gthread.h:138:11`! (sessions);
168 }
169
170 void
171 xdp_session_closecxx . . $ xdp_session_close(e4dd02f38fc14a2). (XdpSessioncxx . . $ XdpSession# *session,
172 gbooleancxx . . $ gboolean# notify_closed)
173 {
174 if (session->closedcxx . . $ _XdpSession#closed.)
175 return;
176
177 XDP_SESSION_GET_CLASScxx . . $ `src/xdp-session.c:55:9`! (session)->closecxx . . $ _XdpSessionClass#close. (session);
178
179 if (notify_closed)
180 {
181 g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) details_builder =
182 G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!);
183
184 g_dbus_connection_emit_signalcxx . . $ g_dbus_connection_emit_signal(e1c7067f953d4fcb). (session->connectioncxx . . $ _XdpSession#connection.,
185 session->sendercxx . . $ _XdpSession#sender.,
186 session->idcxx . . $ _XdpSession#id.,
187 DESKTOP_DBUS_IFACEcxx . . $ `src/xdp-types.h:45:9`! ".Session",
188 "Closed",
189 g_variant_newcxx . . $ g_variant_new(59b7d1999758b6d9). ("(@a{sv})", g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&details_builder)),
190 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
191 }
192
193 if (session->exportedcxx . . $ _XdpSession#exported.)
194 xdp_session_unexportcxx . . $ xdp_session_unexport(ac695378ab375fe8). (session);
195
196 xdp_session_unregistercxx . . $ xdp_session_unregister(ac695378ab375fe8). (session);
197 xdp_context_unclaim_object_pathcxx . . $ xdp_context_unclaim_object_path(d5f567db9407aaf). (session->contextcxx . . $ _XdpSession#context., session->idcxx . . $ _XdpSession#id.);
198
199 if (session->impl_sessioncxx . . $ _XdpSession#impl_session.)
200 {
201 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
202
203 if (!xdp_dbus_impl_session_call_close_synccxx . . $ xdp_dbus_impl_session_call_close_sync(9cfd885e04eb7c74). (session->impl_sessioncxx . . $ _XdpSession#impl_session.,
204 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &error))
205 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Failed to close session implementation: %s",
206 error->message);
207
208 g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&session->impl_session);
209 }
210
211 session->closedcxx . . $ _XdpSession#closed. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
212
213
214 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (session);
215 }
216
217 static gbooleancxx . . $ gboolean#
218 handle_closecxx . . $ handle_close(e6a697152905a2fd). (XdpDbusSessioncxx . . $ XdpDbusSession# *object,
219 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation)
220 {
221 XdpSessioncxx . . $ XdpSession# *session = XDP_SESSIONcxx . . $ XDP_SESSION(a424cc90118498e6). (object);
222
223 SESSION_AUTOLOCK_UNREFcxx . . $ `src/xdp-session.h:81:9`! (g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (session));
224
225 xdp_session_closecxx . . $ xdp_session_close(e4dd02f38fc14a2). (session, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
226
227 xdp_dbus_session_complete_closecxx . . $ xdp_dbus_session_complete_close(e6e0b54d9738c9df). (object, invocation);
228
229 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
230 }
231
232 static void
233 xdp_session_skeleton_iface_initcxx . . $ xdp_session_skeleton_iface_init(858f9834dfa5697a). (XdpDbusSessionIfacecxx . . $ XdpDbusSessionIface# *iface)
234 {
235 iface->handle_closecxx . . $ _XdpDbusSessionIface#handle_close. = handle_closecxx . . $ handle_close(e6a697152905a2fd).;
236 }
237
238 static void
239 on_closedcxx . . $ on_closed(7cfd3ed488ed7d1c). (XdpDbusImplSessioncxx . . $ XdpDbusImplSession# *object, GObjectcxx . . $ GObject# *data)
240 {
241 XdpSessioncxx . . $ XdpSession# *session = XDP_SESSIONcxx . . $ XDP_SESSION(a424cc90118498e6). (data);
242
243 SESSION_AUTOLOCK_UNREFcxx . . $ `src/xdp-session.h:81:9`! (g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (session));
244
245 g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&session->impl_session);
246 xdp_session_closecxx . . $ xdp_session_close(e4dd02f38fc14a2). (session, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!);
247 }
248
249 static gbooleancxx . . $ gboolean#
250 xdp_session_authorize_callbackcxx . . $ xdp_session_authorize_callback(a372c9f6c5124328). (GDBusInterfaceSkeletoncxx . . $ GDBusInterfaceSkeleton# *interface,
251 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation,
252 gpointercxx . . $ gpointer# user_data)
253 {
254 const gcharcxx . . $ gchar# *session_owner = user_data;
255 const gcharcxx . . $ gchar# *sender = g_dbus_method_invocation_get_sendercxx . . $ g_dbus_method_invocation_get_sender(fb2cbbb785aa0d4d). (invocation);
256
257 if (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (sender, session_owner) != 0)
258 {
259 g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation,
260 G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!,
261 G_DBUS_ERROR_ACCESS_DENIEDcxx . . $ G_DBUS_ERROR_ACCESS_DENIED.,
262 "Portal operation not allowed, Unmatched caller");
263 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
264 }
265
266 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
267 }
268
269 static void
270 on_peer_disconnectcxx . . $ on_peer_disconnect(d6fd0b445f519d6). (XdpContextcxx . . $ XdpContext# *context,
271 const char *peer,
272 gpointercxx . . $ gpointer# user_data)
273 {
274 XdpSessioncxx . . $ XdpSession# *session = XDP_SESSIONcxx . . $ XDP_SESSION(a424cc90118498e6). (user_data);
275
276 SESSION_AUTOLOCKcxx . . $ `src/xdp-session.h:78:9`! (session);
277
278 if (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (session->sendercxx . . $ _XdpSession#sender., peer) != 0)
279 return;
280
281 xdp_session_closecxx . . $ xdp_session_close(e4dd02f38fc14a2). (session, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
282 }
283
284 static gbooleancxx . . $ gboolean#
285 xdp_session_initable_initcxx . . $ xdp_session_initable_init(4c297c0fcb9fff71). (GInitablecxx . . $ GInitable# *initable,
286 GCancellablecxx . . $ GCancellable# *cancellable,
287 GErrorcxx . . $ GError# **error)
288 {
289 XdpSessioncxx . . $ XdpSession# *session = XDP_SESSIONcxx . . $ XDP_SESSION(a424cc90118498e6). (initable);
290 g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *sender_escaped = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
291 g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *id = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
292 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpDbusImplSession) impl_session = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
293 int i;
294
295 g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (session->sender != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
296 g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (session->token != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
297 g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (session->context != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
298
299 sender_escaped = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (session->sender + 1);
300 for (i = 0; sender_escaped[i]; i++)
301 {
302 if (sender_escaped[i] == '.')
303 sender_escaped[i] = '_';
304 }
305
306 if (!session->tokencxx . . $ _XdpSession#token.)
307 {
308 g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_FAILEDcxx . . $ G_IO_ERROR_FAILED., "Missing token");
309 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
310 }
311
312 if (!xdp_is_valid_tokencxx . . $ xdp_is_valid_token(5c4306d8553b3696). (session->tokencxx . . $ _XdpSession#token.))
313 {
314 g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error,
315 XDG_DESKTOP_PORTAL_ERRORcxx . . $ `src/xdp-utils.h:115:9`!,
316 XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENTcxx . . $ XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENT.,
317 "Invalid token '%s'", session->tokencxx . . $ _XdpSession#token.);
318 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
319 }
320
321 id = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). (DESKTOP_DBUS_PATHcxx . . $ `src/xdp-types.h:47:9`! "/session/%s/%s",
322 sender_escaped, session->tokencxx . . $ _XdpSession#token.);
323
324 while (!xdp_context_claim_object_pathcxx . . $ xdp_context_claim_object_path(738797183355f6b2). (session->contextcxx . . $ _XdpSession#context., id))
325 {
326 g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *t = xdp_generate_tokencxx . . $ xdp_generate_token(41208ce6ca65dd58). ();
327 g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&id, g_free);
328 id = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). (DESKTOP_DBUS_PATHcxx . . $ `src/xdp-types.h:47:9`! "/session/%s/%s/%s",
329 sender_escaped,
330 session->tokencxx . . $ _XdpSession#token.,
331 t);
332 }
333
334 if (session->impl_dbus_namecxx . . $ _XdpSession#impl_dbus_name.)
335 {
336 impl_session =
337 xdp_dbus_impl_session_proxy_new_synccxx . . $ xdp_dbus_impl_session_proxy_new_sync(fe857ca025a7257d). (session->impl_connectioncxx . . $ _XdpSession#impl_connection.,
338 G_DBUS_PROXY_FLAGS_NONEcxx . . $ G_DBUS_PROXY_FLAGS_NONE.,
339 session->impl_dbus_namecxx . . $ _XdpSession#impl_dbus_name.,
340 id,
341 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, error);
342 if (!impl_session)
343 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
344
345 g_signal_connect_objectcxx . . $ g_signal_connect_object(567cfbe0c886a38e). (impl_session, "closed",
346 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (on_closed),
347 session,
348 G_CONNECT_DEFAULTcxx . . $ G_CONNECT_DEFAULT.);
349
350 session->impl_sessioncxx . . $ _XdpSession#impl_session. = g_steal_pointercxx . . $ `<external>/1123956534522462559/gmem.h:250:9`! (&impl_session);
351 }
352
353 session->idcxx . . $ _XdpSession#id. = g_steal_pointercxx . . $ `<external>/1123956534522462559/gmem.h:250:9`! (&id);
354
355 g_dbus_interface_skeleton_set_flagscxx . . $ g_dbus_interface_skeleton_set_flags(9e6b05200e191a32). (G_DBUS_INTERFACE_SKELETONcxx . . $ `<external>/1991948168568871819/gdbusinterfaceskeleton.h:32:9`! (session),
356 G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREADcxx . . $ G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD.);
357 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (session, "g-authorize-method",
358 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (xdp_session_authorize_callback),
359 session->sender);
360
361 g_signal_connect_objectcxx . . $ g_signal_connect_object(567cfbe0c886a38e). (session->contextcxx . . $ _XdpSession#context., "peer-disconnect",
362 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (on_peer_disconnect),
363 session,
364 G_CONNECT_DEFAULTcxx . . $ G_CONNECT_DEFAULT.);
365
366 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
367 }
368
369 static void
370 g_initable_iface_initcxx . . $ g_initable_iface_init(d44eb3c02fde4f8c). (GInitableIfacecxx . . $ GInitableIface# *iface)
371 {
372 iface->initcxx . . $ _GInitableIface#init. = xdp_session_initable_initcxx . . $ xdp_session_initable_init(4c297c0fcb9fff71).;
373 }
374
375 static void
376 xdp_session_set_propertycxx . . $ xdp_session_set_property(d7c4bb29f36c0dc4). (GObjectcxx . . $ GObject# *object,
377 guintcxx . . $ guint# prop_id,
378 const GValuecxx . . $ GValue# *value,
379 GParamSpeccxx . . $ GParamSpec# *pspec)
380 {
381 XdpSessioncxx . . $ XdpSession# *session = XDP_SESSIONcxx . . $ XDP_SESSION(a424cc90118498e6). (object);
382
383 switch ((XdpSessionPropscxx . . $ XdpSessionProps#) prop_id)
384 {
385 case PROP_CONTEXTcxx . . $ PROP_CONTEXT.:
386 session->contextcxx . . $ _XdpSession#context. = g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce). (value);
387 break;
388
389 case PROP_SENDERcxx . . $ PROP_SENDER.:
390 session->sendercxx . . $ _XdpSession#sender. = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (g_value_get_string (value));
391 break;
392
393 case PROP_APP_IDcxx . . $ PROP_APP_ID.:
394 session->app_idcxx . . $ _XdpSession#app_id. = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (g_value_get_string (value));
395 break;
396
397 case PROP_TOKENcxx . . $ PROP_TOKEN.:
398 session->tokencxx . . $ _XdpSession#token. = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (g_value_get_string (value));
399 break;
400
401 case PROP_CONNECTIONcxx . . $ PROP_CONNECTION.:
402 g_set_objectcxx . . $ `<external>/1341695927569185362/gobject.h:762:9`! (&session->connection, g_value_get_object (value));
403 break;
404
405 case PROP_IMPL_CONNECTIONcxx . . $ PROP_IMPL_CONNECTION.:
406 g_set_objectcxx . . $ `<external>/1341695927569185362/gobject.h:762:9`! (&session->impl_connection, g_value_get_object (value));
407 break;
408
409 case PROP_IMPL_DBUS_NAMEcxx . . $ PROP_IMPL_DBUS_NAME.:
410 session->impl_dbus_namecxx . . $ _XdpSession#impl_dbus_name. = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (g_value_get_string (value));
411 break;
412 }
413 }
414
415 static void
416 xdp_session_get_propertycxx . . $ xdp_session_get_property(cee2c52f22407c66). (GObjectcxx . . $ GObject# *object,
417 guintcxx . . $ guint# prop_id,
418 GValuecxx . . $ GValue# *value,
419 GParamSpeccxx . . $ GParamSpec# *pspec)
420 {
421 XdpSessioncxx . . $ XdpSession# *session = XDP_SESSIONcxx . . $ XDP_SESSION(a424cc90118498e6). (object);
422
423 switch ((XdpSessionPropscxx . . $ XdpSessionProps#) prop_id)
424 {
425 case PROP_CONTEXTcxx . . $ PROP_CONTEXT.:
426 g_value_set_objectcxx . . $ g_value_set_object(e945b84c1e9702f). (value, session->contextcxx . . $ _XdpSession#context.);
427 break;
428
429 case PROP_SENDERcxx . . $ PROP_SENDER.:
430 g_value_set_stringcxx . . $ g_value_set_string(65b9ea7708b82b9b). (value, session->sendercxx . . $ _XdpSession#sender.);
431 break;
432
433 case PROP_APP_IDcxx . . $ PROP_APP_ID.:
434 g_value_set_stringcxx . . $ g_value_set_string(65b9ea7708b82b9b). (value, session->app_idcxx . . $ _XdpSession#app_id.);
435 break;
436
437 case PROP_TOKENcxx . . $ PROP_TOKEN.:
438 g_value_set_stringcxx . . $ g_value_set_string(65b9ea7708b82b9b). (value, session->tokencxx . . $ _XdpSession#token.);
439 break;
440
441 case PROP_CONNECTIONcxx . . $ PROP_CONNECTION.:
442 g_value_set_objectcxx . . $ g_value_set_object(e945b84c1e9702f). (value, session->connectioncxx . . $ _XdpSession#connection.);
443 break;
444
445 case PROP_IMPL_CONNECTIONcxx . . $ PROP_IMPL_CONNECTION.:
446 g_value_set_objectcxx . . $ g_value_set_object(e945b84c1e9702f). (value, session->impl_connectioncxx . . $ _XdpSession#impl_connection.);
447 break;
448
449 case PROP_IMPL_DBUS_NAMEcxx . . $ PROP_IMPL_DBUS_NAME.:
450 g_value_set_stringcxx . . $ g_value_set_string(65b9ea7708b82b9b). (value, session->impl_dbus_namecxx . . $ _XdpSession#impl_dbus_name.);
451 break;
452 }
453 }
454
455 static void
456 xdp_session_finalizecxx . . $ xdp_session_finalize(6087475fa43034d3). (GObjectcxx . . $ GObject# *object)
457 {
458 XdpSessioncxx . . $ XdpSession# *session = XDP_SESSIONcxx . . $ XDP_SESSION(a424cc90118498e6). (object);
459
460 g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (!session->id || !g_hash_table_lookup (sessions, session->id));
461
462 g_freecxx . . $ g_free(5d22bdacc48458e8). (session->sendercxx . . $ _XdpSession#sender.);
463 g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&session->connection);
464
465 g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&session->impl_connection);
466 g_freecxx . . $ g_free(5d22bdacc48458e8). (session->impl_dbus_namecxx . . $ _XdpSession#impl_dbus_name.);
467 g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&session->impl_session);
468
469 g_freecxx . . $ g_free(5d22bdacc48458e8). (session->app_idcxx . . $ _XdpSession#app_id.);
470 g_freecxx . . $ g_free(5d22bdacc48458e8). (session->idcxx . . $ _XdpSession#id.);
471 g_freecxx . . $ g_free(5d22bdacc48458e8). (session->tokencxx . . $ _XdpSession#token.);
472
473 g_mutex_clearcxx . . $ g_mutex_clear(d80b1953a7cb7fd1). (&session->mutexcxx . . $ _XdpSession#mutex.);
474
475 G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (xdp_session_parent_class)->finalizecxx . . $ _GObjectClass#finalize. (object);
476 }
477
478 static void
479 xdp_session_initcxx . . $ xdp_session_init(ac695378ab375fe8). (XdpSessioncxx . . $ XdpSession# *session)
480 {
481 g_mutex_initcxx . . $ g_mutex_init(d80b1953a7cb7fd1). (&session->mutexcxx . . $ _XdpSession#mutex.);
482 }
483
484 static void
485 xdp_session_class_initcxx . . $ xdp_session_class_init(14fc59113f743ea3). (XdpSessionClasscxx . . $ XdpSessionClass# *klass)
486 {
487 GObjectClasscxx . . $ GObjectClass# *gobject_class;
488
489 sessionscxx . . $ sessions. = g_hash_table_new_fullcxx . . $ g_hash_table_new_full(e2dd12b570de7430). (g_str_hashcxx . . $ g_str_hash(b11f534102b1ad6)., g_str_equalcxx . . $ g_str_equal(9148c8c3ff42c9d8).,
490 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
491
492 gobject_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (klass);
493 gobject_class->finalizecxx . . $ _GObjectClass#finalize. = xdp_session_finalizecxx . . $ xdp_session_finalize(6087475fa43034d3).;
494 gobject_class->set_propertycxx . . $ _GObjectClass#set_property. = xdp_session_set_propertycxx . . $ xdp_session_set_property(d7c4bb29f36c0dc4).;
495 gobject_class->get_propertycxx . . $ _GObjectClass#get_property. = xdp_session_get_propertycxx . . $ xdp_session_get_property(cee2c52f22407c66).;
496
497 obj_propscxx . . $ obj_props.[PROP_CONTEXTcxx . . $ PROP_CONTEXT.] =
498 g_param_spec_objectcxx . . $ g_param_spec_object(faf99966f027a127). ("context",
499 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
500 XDP_TYPE_CONTEXTcxx . . $ `src/xdp-context.h:32:9`!,
501 G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. |
502 G_PARAM_CONSTRUCT_ONLYcxx . . $ G_PARAM_CONSTRUCT_ONLY. |
503 G_PARAM_STATIC_STRINGScxx . . $ `<external>/7453068347527694854/gparam.h:187:9`!);
504
505 obj_propscxx . . $ obj_props.[PROP_SENDERcxx . . $ PROP_SENDER.] =
506 g_param_spec_stringcxx . . $ g_param_spec_string(378e8746be5cd899). ("sender",
507 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
508 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
509 G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. |
510 G_PARAM_CONSTRUCT_ONLYcxx . . $ G_PARAM_CONSTRUCT_ONLY. |
511 G_PARAM_STATIC_STRINGScxx . . $ `<external>/7453068347527694854/gparam.h:187:9`!);
512
513 obj_propscxx . . $ obj_props.[PROP_APP_IDcxx . . $ PROP_APP_ID.] =
514 g_param_spec_stringcxx . . $ g_param_spec_string(378e8746be5cd899). ("app-id",
515 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
516 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
517 G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. |
518 G_PARAM_CONSTRUCT_ONLYcxx . . $ G_PARAM_CONSTRUCT_ONLY. |
519 G_PARAM_STATIC_STRINGScxx . . $ `<external>/7453068347527694854/gparam.h:187:9`!);
520
521 obj_propscxx . . $ obj_props.[PROP_TOKENcxx . . $ PROP_TOKEN.] =
522 g_param_spec_stringcxx . . $ g_param_spec_string(378e8746be5cd899). ("token",
523 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
524 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
525 G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. |
526 G_PARAM_CONSTRUCT_ONLYcxx . . $ G_PARAM_CONSTRUCT_ONLY. |
527 G_PARAM_STATIC_STRINGScxx . . $ `<external>/7453068347527694854/gparam.h:187:9`!);
528
529 obj_propscxx . . $ obj_props.[PROP_CONNECTIONcxx . . $ PROP_CONNECTION.] =
530 g_param_spec_objectcxx . . $ g_param_spec_object(faf99966f027a127). ("connection",
531 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
532 G_TYPE_DBUS_CONNECTIONcxx . . $ `<external>/12412075152584512215/gdbusconnection.h:34:9`!,
533 G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. |
534 G_PARAM_CONSTRUCT_ONLYcxx . . $ G_PARAM_CONSTRUCT_ONLY. |
535 G_PARAM_STATIC_STRINGScxx . . $ `<external>/7453068347527694854/gparam.h:187:9`!);
536
537 obj_propscxx . . $ obj_props.[PROP_IMPL_CONNECTIONcxx . . $ PROP_IMPL_CONNECTION.] =
538 g_param_spec_objectcxx . . $ g_param_spec_object(faf99966f027a127). ("impl-connection",
539 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
540 G_TYPE_DBUS_CONNECTIONcxx . . $ `<external>/12412075152584512215/gdbusconnection.h:34:9`!,
541 G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. |
542 G_PARAM_CONSTRUCT_ONLYcxx . . $ G_PARAM_CONSTRUCT_ONLY. |
543 G_PARAM_STATIC_STRINGScxx . . $ `<external>/7453068347527694854/gparam.h:187:9`!);
544
545 obj_propscxx . . $ obj_props.[PROP_IMPL_DBUS_NAMEcxx . . $ PROP_IMPL_DBUS_NAME.] =
546 g_param_spec_stringcxx . . $ g_param_spec_string(378e8746be5cd899). ("impl-dbus-name",
547 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
548 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
549 G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. |
550 G_PARAM_CONSTRUCT_ONLYcxx . . $ G_PARAM_CONSTRUCT_ONLY. |
551 G_PARAM_STATIC_STRINGScxx . . $ `<external>/7453068347527694854/gparam.h:187:9`!);
552
553 g_object_class_install_propertiescxx . . $ g_object_class_install_properties(569d03e6a4088541). (gobject_class, G_N_ELEMENTScxx . . $ `<external>/12741050725406041920/gmacros.h:993:9`! (obj_props), obj_propscxx . . $ obj_props.);
554 }