Merge lp:~ken-vandine/ubuntu-app-launch/untrusted-helper-uris into lp:~ted/ubuntu-app-launch/untrusted-helper

Proposed by Ken VanDine
Status: Merged
Merged at revision: 110
Proposed branch: lp:~ken-vandine/ubuntu-app-launch/untrusted-helper-uris
Merge into: lp:~ted/ubuntu-app-launch/untrusted-helper
Diff against target: 90 lines (+15/-7)
3 files modified
libupstart-app-launch/upstart-app-launch.c (+10/-5)
libupstart-app-launch/upstart-app-launch.h (+4/-2)
upstart-jobs/untrusted-helper.conf.in (+1/-0)
To merge this branch: bzr merge lp:~ken-vandine/ubuntu-app-launch/untrusted-helper-uris
Reviewer Review Type Date Requested Status
Ted Gould Pending
Review via email: mp+203174@code.launchpad.net

Commit message

Added APP_URIS to start_helper and start_multiple_helper

Description of the change

Added APP_URIS to start_helper and start_multiple_helper

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libupstart-app-launch/upstart-app-launch.c'
2--- libupstart-app-launch/upstart-app-launch.c 2014-01-24 16:26:40 +0000
3+++ libupstart-app-launch/upstart-app-launch.c 2014-01-24 20:42:33 +0000
4@@ -1075,7 +1075,7 @@
5 to define the instance. In the end there's only one job with
6 an array of instances. */
7 static gboolean
8-start_helper_core (const gchar * type, const gchar * appid, const gchar * instance)
9+start_helper_core (const gchar * type, const gchar * appid, const gchar * const * uris, const gchar * instance)
10 {
11 GDBusConnection * con = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, NULL);
12 g_return_val_if_fail(con != NULL, FALSE);
13@@ -1089,6 +1089,11 @@
14 g_variant_builder_add_value(&builder, g_variant_new_take_string(g_strdup_printf("APP_ID=%s", appid)));
15 g_variant_builder_add_value(&builder, g_variant_new_take_string(g_strdup_printf("HELPER_TYPE=%s", type)));
16
17+ if (uris != NULL) {
18+ gchar * urisjoin = app_uris_string(uris);
19+ g_variant_builder_add_value(&builder, g_variant_new_take_string(g_strdup_printf("APP_URIS=%s", urisjoin)));
20+ }
21+
22 if (instance != NULL) {
23 g_variant_builder_add_value(&builder, g_variant_new_take_string(g_strdup_printf("INSTANCE_ID=%s", instance)));
24 }
25@@ -1116,17 +1121,17 @@
26 }
27
28 gboolean
29-upstart_app_launch_start_helper (const gchar * type, const gchar * appid)
30+upstart_app_launch_start_helper (const gchar * type, const gchar * appid, const gchar * const * uris)
31 {
32 g_return_val_if_fail(type != NULL, FALSE);
33 g_return_val_if_fail(appid != NULL, FALSE);
34 g_return_val_if_fail(g_strstr_len(type, -1, ":") == NULL, FALSE);
35
36- return start_helper_core(type, appid, NULL);
37+ return start_helper_core(type, appid, uris, NULL);
38 }
39
40 gchar *
41-upstart_app_launch_start_multiple_helper (const gchar * type, const gchar * appid)
42+upstart_app_launch_start_multiple_helper (const gchar * type, const gchar * appid, const gchar * const * uris)
43 {
44 g_return_val_if_fail(type != NULL, NULL);
45 g_return_val_if_fail(appid != NULL, NULL);
46@@ -1134,7 +1139,7 @@
47
48 gchar * instanceid = g_strdup_printf("%" G_GUINT64_FORMAT, g_get_real_time());
49
50- if (start_helper_core(type, appid, instanceid)) {
51+ if (start_helper_core(type, appid, uris, instanceid)) {
52 return instanceid;
53 }
54
55
56=== modified file 'libupstart-app-launch/upstart-app-launch.h'
57--- libupstart-app-launch/upstart-app-launch.h 2014-01-24 16:26:40 +0000
58+++ libupstart-app-launch/upstart-app-launch.h 2014-01-24 20:42:33 +0000
59@@ -299,7 +299,8 @@
60 * Return value: Whether the helper was able to be started
61 */
62 gboolean upstart_app_launch_start_helper (const gchar * type,
63- const gchar * appid);
64+ const gchar * appid,
65+ const gchar * const * uris);
66
67 /**
68 * upstart_app_launch_start_multiple_helper:
69@@ -317,7 +318,8 @@
70 * Return value: The generated instance ID or NULL on failure
71 */
72 gchar * upstart_app_launch_start_multiple_helper (const gchar * type,
73- const gchar * appid);
74+ const gchar * appid,
75+ const gchar * const * uris);
76
77 /**
78 * upstart_app_launch_stop_helper:
79
80=== modified file 'upstart-jobs/untrusted-helper.conf.in'
81--- upstart-jobs/untrusted-helper.conf.in 2014-01-23 22:57:43 +0000
82+++ upstart-jobs/untrusted-helper.conf.in 2014-01-24 20:42:33 +0000
83@@ -9,6 +9,7 @@
84 env APP_EXEC="echo Error"
85 env HELPER_TYPE
86 env INSTANCE_ID=""
87+env APP_URIS
88
89 env UPSTART_APP_LAUNCH_ARCH="@upstart_app_launch_arch@"
90 export UPSTART_APP_LAUNCH_ARCH

Subscribers

People subscribed via source and target branches

to all changes: