[libsoup/http2: 10/10] drop soup_session_get_queue(), add soup_session_lookup_queue_item()



commit 44e1c85cd4b672eeba880aee63317e0273996afc
Author: Dan Winship <danw gnome org>
Date:   Tue Dec 10 15:52:27 2013 +0100

    drop soup_session_get_queue(), add soup_session_lookup_queue_item()

 libsoup/soup-session-async.c   |    4 +---
 libsoup/soup-session-private.h |    3 ++-
 libsoup/soup-session.c         |   25 +++++++++----------------
 3 files changed, 12 insertions(+), 20 deletions(-)
---
diff --git a/libsoup/soup-session-async.c b/libsoup/soup-session-async.c
index b935348..b72e252 100644
--- a/libsoup/soup-session-async.c
+++ b/libsoup/soup-session-async.c
@@ -104,14 +104,12 @@ static void
 soup_session_async_cancel_message (SoupSession *session, SoupMessage *msg,
                                   guint status_code)
 {
-       SoupMessageQueue *queue;
        SoupMessageQueueItem *item;
 
        SOUP_SESSION_CLASS (soup_session_async_parent_class)->
                cancel_message (session, msg, status_code);
 
-       queue = soup_session_get_queue (session);
-       item = soup_message_queue_lookup (queue, msg);
+       item = soup_session_lookup_queue_item (session, msg);
        if (!item)
                return;
 
diff --git a/libsoup/soup-session-private.h b/libsoup/soup-session-private.h
index b769e9d..d50dc5c 100644
--- a/libsoup/soup-session-private.h
+++ b/libsoup/soup-session-private.h
@@ -15,7 +15,8 @@ G_BEGIN_DECLS
 #define SOUP_SESSION_SOCKET_PROPERTIES "socket-properties"
 
 /* "protected" methods for subclasses */
-SoupMessageQueue     *soup_session_get_queue            (SoupSession          *session);
+SoupMessageQueueItem *soup_session_lookup_queue_item    (SoupSession          *session,
+                                                        SoupMessage          *msg);
 
 SoupMessageQueueItem *soup_session_append_queue_item    (SoupSession          *session,
                                                         SoupMessage          *msg,
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index 6502a14..77f63da 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -1354,12 +1354,13 @@ connection_state_changed (GObject *object, GParamSpec *param, gpointer user_data
                soup_session_kick_queue (session);
 }
 
-SoupMessageQueue *
-soup_session_get_queue (SoupSession *session)
+SoupMessageQueueItem *
+soup_session_lookup_queue_item (SoupSession *session,
+                               SoupMessage *msg)
 {
        SoupSessionPrivate *priv = SOUP_SESSION_GET_PRIVATE (session);
 
-       return priv->queue;
+       return soup_message_queue_lookup (priv->queue, msg);
 }
 
 static void
@@ -1996,10 +1997,9 @@ soup_session_queue_message (SoupSession *session, SoupMessage *msg,
 static void
 soup_session_real_requeue_message (SoupSession *session, SoupMessage *msg)
 {
-       SoupSessionPrivate *priv = SOUP_SESSION_GET_PRIVATE (session);
        SoupMessageQueueItem *item;
 
-       item = soup_message_queue_lookup (priv->queue, msg);
+       item = soup_session_lookup_queue_item (session, msg);
        g_return_if_fail (item != NULL);
 
        if (item->resend_count >= SOUP_SESSION_MAX_RESEND_COUNT) {
@@ -2095,14 +2095,12 @@ void
 soup_session_pause_message (SoupSession *session,
                            SoupMessage *msg)
 {
-       SoupSessionPrivate *priv;
        SoupMessageQueueItem *item;
 
        g_return_if_fail (SOUP_IS_SESSION (session));
        g_return_if_fail (SOUP_IS_MESSAGE (msg));
 
-       priv = SOUP_SESSION_GET_PRIVATE (session);
-       item = soup_message_queue_lookup (priv->queue, msg);
+       item = soup_session_lookup_queue_item (session, msg);
        g_return_if_fail (item != NULL);
        g_return_if_fail (item->async);
 
@@ -2176,14 +2174,12 @@ void
 soup_session_unpause_message (SoupSession *session,
                              SoupMessage *msg)
 {
-       SoupSessionPrivate *priv;
        SoupMessageQueueItem *item;
 
        g_return_if_fail (SOUP_IS_SESSION (session));
        g_return_if_fail (SOUP_IS_MESSAGE (msg));
 
-       priv = SOUP_SESSION_GET_PRIVATE (session);
-       item = soup_message_queue_lookup (priv->queue, msg);
+       item = soup_session_lookup_queue_item (session, msg);
        g_return_if_fail (item != NULL);
        g_return_if_fail (item->async);
 
@@ -2199,10 +2195,9 @@ soup_session_unpause_message (SoupSession *session,
 static void
 soup_session_real_cancel_message (SoupSession *session, SoupMessage *msg, guint status_code)
 {
-       SoupSessionPrivate *priv = SOUP_SESSION_GET_PRIVATE (session);
        SoupMessageQueueItem *item;
 
-       item = soup_message_queue_lookup (priv->queue, msg);
+       item = soup_session_lookup_queue_item (session, msg);
        g_return_if_fail (item != NULL);
 
        item->paused = FALSE;
@@ -2247,14 +2242,12 @@ void
 soup_session_cancel_message (SoupSession *session, SoupMessage *msg,
                             guint status_code)
 {
-       SoupSessionPrivate *priv;
        SoupMessageQueueItem *item;
 
        g_return_if_fail (SOUP_IS_SESSION (session));
        g_return_if_fail (SOUP_IS_MESSAGE (msg));
 
-       priv = SOUP_SESSION_GET_PRIVATE (session);
-       item = soup_message_queue_lookup (priv->queue, msg);
+       item = soup_session_lookup_queue_item (session, msg);
        /* If the message is already ending, don't do anything */
        if (!item)
                return;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]