Commit 49bb7cff authored by Stef Walter's avatar Stef Walter

gio: Add GTlsInteraction interaction method invocation guarantees

 * Add 'invoke' style method, which can be used to call an interaction
   from any thread. The interaction will be run in the appropriate
   #GMainContext
 * Sync methods can be called whether main loop is running or not.
 * Derived classes can choose to implement only sync or async
   interaction method, and the invoke method will fill in the blanks.
 * Documentation for the above.
 * Tests for the above.

https://bugzilla.gnome.org/show_bug.cgi?id=657567
parent 116b2932
......@@ -40,3 +40,4 @@ README
ChangeLog
/glib-lcov.info
/glib-lcov/
/gio/tests/tls-interaction
......@@ -1486,6 +1486,7 @@ g_tls_interaction_get_type
g_tls_interaction_ask_password
g_tls_interaction_ask_password_async
g_tls_interaction_ask_password_finish
g_tls_interaction_invoke_ask_password
g_tls_interaction_result_get_type
g_tls_password_flags_get_type
g_tls_password_get_type
......
This diff is collapsed.
......@@ -43,17 +43,17 @@ typedef struct _GTlsInteractionPrivate GTlsInteractionPrivate;
struct _GTlsInteraction
{
/*< private >*/
GObject parent_instance;
GTlsInteractionPrivate *priv;
};
struct _GTlsInteractionClass
{
/*< private >*/
GObjectClass parent_class;
/* virtual methods: */
/*< public >*/
GTlsInteractionResult (* ask_password) (GTlsInteraction *interaction,
GTlsPassword *password,
GCancellable *cancellable,
......@@ -76,6 +76,12 @@ struct _GTlsInteractionClass
GType g_tls_interaction_get_type (void) G_GNUC_CONST;
GTlsInteractionResult g_tls_interaction_invoke_ask_password (GTlsInteraction *interaction,
GTlsPassword *password,
GCancellable *cancellable,
GError **error);
GTlsInteractionResult g_tls_interaction_ask_password (GTlsInteraction *interaction,
GTlsPassword *password,
GCancellable *cancellable,
......
......@@ -52,6 +52,7 @@ TEST_PROGS += \
socket \
pollable \
tls-certificate \
tls-interaction \
cancellable \
$(NULL)
......@@ -468,6 +469,8 @@ proxy_LDADD = $(progs_ldadd) \
tls_certificate_SOURCES = tls-certificate.c gtesttlsbackend.c gtesttlsbackend.h
tls_certificate_LDADD = $(progs_ldadd)
tls_interaction_LDADD = $(progs_ldadd)
cancellable_LDADD = $(progs_ldadd)
# -----------------------------------------------------------------------------
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment