[libsoup/wip/http2: 6/7] drop soup_session_get_queue(), add soup_session_lookup_queue_item()



commit 5b19fa97a8ad673fdaa6e5d091ecd888c9b923f3
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 dc4d300..7da6781 100644
--- a/libsoup/soup-session-private.h
+++ b/libsoup/soup-session-private.h
@@ -13,7 +13,8 @@
 G_BEGIN_DECLS
 
 /* "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 4f73e53..9002e22 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -1417,12 +1417,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
@@ -2115,10 +2116,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) {
@@ -2214,14 +2214,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);
 
@@ -2295,14 +2293,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);
 
@@ -2318,10 +2314,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;
@@ -2366,14 +2361,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]