[libsoup] Make SoupWebsocketConnection a final type
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] Make SoupWebsocketConnection a final type
- Date: Thu, 29 Oct 2020 21:44:24 +0000 (UTC)
commit b7b0bd1b9155f2c9eca885de3a86b13b54e27ed7
Author: Patrick Griffis <pgriffis igalia com>
Date: Thu Oct 29 16:34:10 2020 -0500
Make SoupWebsocketConnection a final type
libsoup/websocket/soup-websocket-connection.c | 14 +++++++++-----
libsoup/websocket/soup-websocket-connection.h | 21 +--------------------
2 files changed, 10 insertions(+), 25 deletions(-)
---
diff --git a/libsoup/websocket/soup-websocket-connection.c b/libsoup/websocket/soup-websocket-connection.c
index a6c34f40..ecce2e89 100644
--- a/libsoup/websocket/soup-websocket-connection.c
+++ b/libsoup/websocket/soup-websocket-connection.c
@@ -113,6 +113,10 @@ typedef struct {
gboolean pending;
} Frame;
+struct _SoupWebsocketConnection {
+ GObject parent_instance;
+};
+
typedef struct {
GIOStream *io_stream;
SoupWebsocketConnectionType connection_type;
@@ -1653,7 +1657,7 @@ soup_websocket_connection_class_init (SoupWebsocketConnectionClass *klass)
signals[MESSAGE] = g_signal_new ("message",
SOUP_TYPE_WEBSOCKET_CONNECTION,
G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (SoupWebsocketConnectionClass, message),
+ 0,
NULL, NULL, g_cclosure_marshal_generic,
G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_BYTES);
@@ -1671,7 +1675,7 @@ soup_websocket_connection_class_init (SoupWebsocketConnectionClass *klass)
signals[ERROR] = g_signal_new ("error",
SOUP_TYPE_WEBSOCKET_CONNECTION,
G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (SoupWebsocketConnectionClass, error),
+ 0,
NULL, NULL, g_cclosure_marshal_generic,
G_TYPE_NONE, 1, G_TYPE_ERROR);
@@ -1686,7 +1690,7 @@ soup_websocket_connection_class_init (SoupWebsocketConnectionClass *klass)
signals[CLOSING] = g_signal_new ("closing",
SOUP_TYPE_WEBSOCKET_CONNECTION,
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (SoupWebsocketConnectionClass, closing),
+ 0,
NULL, NULL, g_cclosure_marshal_generic,
G_TYPE_NONE, 0);
@@ -1706,7 +1710,7 @@ soup_websocket_connection_class_init (SoupWebsocketConnectionClass *klass)
signals[CLOSED] = g_signal_new ("closed",
SOUP_TYPE_WEBSOCKET_CONNECTION,
G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (SoupWebsocketConnectionClass, closed),
+ 0,
NULL, NULL, g_cclosure_marshal_generic,
G_TYPE_NONE, 0);
@@ -1727,7 +1731,7 @@ soup_websocket_connection_class_init (SoupWebsocketConnectionClass *klass)
signals[PONG] = g_signal_new ("pong",
SOUP_TYPE_WEBSOCKET_CONNECTION,
G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (SoupWebsocketConnectionClass, pong),
+ 0,
NULL, NULL, g_cclosure_marshal_generic,
G_TYPE_NONE, 1, G_TYPE_BYTES);
}
diff --git a/libsoup/websocket/soup-websocket-connection.h b/libsoup/websocket/soup-websocket-connection.h
index 503ba19c..5cd4b8f6 100644
--- a/libsoup/websocket/soup-websocket-connection.h
+++ b/libsoup/websocket/soup-websocket-connection.h
@@ -27,26 +27,7 @@ G_BEGIN_DECLS
#define SOUP_TYPE_WEBSOCKET_CONNECTION (soup_websocket_connection_get_type ())
SOUP_AVAILABLE_IN_2_50
-G_DECLARE_DERIVABLE_TYPE (SoupWebsocketConnection, soup_websocket_connection, SOUP, WEBSOCKET_CONNECTION,
GObject)
-
-struct _SoupWebsocketConnectionClass {
- GObjectClass parent;
-
- /* signals */
- void (* message) (SoupWebsocketConnection *self,
- SoupWebsocketDataType type,
- GBytes *message);
-
- void (* error) (SoupWebsocketConnection *self,
- GError *error);
-
- void (* closing) (SoupWebsocketConnection *self);
-
- void (* closed) (SoupWebsocketConnection *self);
-
- void (* pong) (SoupWebsocketConnection *self,
- GBytes *message);
-};
+G_DECLARE_FINAL_TYPE (SoupWebsocketConnection, soup_websocket_connection, SOUP, WEBSOCKET_CONNECTION,
GObject)
SOUP_AVAILABLE_IN_2_50
SoupWebsocketConnection *soup_websocket_connection_new (GIOStream *stream,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]