[at-spi2-core: 32/47] impl_Embed: extract function with the actual logic of the method
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-core: 32/47] impl_Embed: extract function with the actual logic of the method
- Date: Wed, 13 Jul 2022 03:08:29 +0000 (UTC)
commit cd31800c9380a08925bbd0beffa97a799525c2ba
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Jul 11 17:48:25 2022 -0500
impl_Embed: extract function with the actual logic of the method
registryd/registry.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/registryd/registry.c b/registryd/registry.c
index 2d252c33..5e08f6e4 100644
--- a/registryd/registry.c
+++ b/registryd/registry.c
@@ -435,10 +435,19 @@ socket_embed_demarshal (DBusMessage *message, SpiReference **out_app_root)
return DEMARSHAL_STATUS_SUCCESS;
}
+static SpiReference *
+socket_embed (SpiRegistry *registry, SpiReference *app_root)
+{
+ add_application (registry, app_root);
+ set_id (registry, app_root);
+ return spi_reference_new (registry->bus_unique_name, SPI_DBUS_PATH_ROOT);
+}
+
static DBusMessage*
impl_Embed (DBusMessage *message, SpiRegistry *registry)
{
SpiReference *app_root = NULL;
+ SpiReference *result;
if (socket_embed_demarshal (message, &app_root) != DEMARSHAL_STATUS_SUCCESS)
{
@@ -448,14 +457,12 @@ impl_Embed (DBusMessage *message, SpiRegistry *registry)
DBusMessage *reply = NULL;
DBusMessageIter reply_iter;
- add_application (registry, app_root);
- set_id (registry, app_root);
+ result = socket_embed (registry, app_root); /* takes ownership of the app_root */
reply = dbus_message_new_method_return (message);
dbus_message_iter_init_append (reply, &reply_iter);
- append_reference (&reply_iter,
- registry->bus_unique_name,
- SPI_DBUS_PATH_ROOT);
+ append_reference (&reply_iter, result->name, result->path);
+ spi_reference_free (result);
return reply;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]