[telepathy-mission-control/master] _mcd_dispatch_operation_run_clients: move from McdDispatcher

Simon McVittie simon.mcvittie at collabora.co.uk
Mon Nov 2 06:41:43 PST 2009


This removes CTXREF07 from the McdDispatcher: in practice, it was never
taken without CTXREF01 already in effect.
---
 src/mcd-dispatch-operation-priv.h |    4 +---
 src/mcd-dispatch-operation.c      |   31 ++++++++++++++++++++++++++-----
 src/mcd-dispatcher.c              |   33 +--------------------------------
 3 files changed, 28 insertions(+), 40 deletions(-)

diff --git a/src/mcd-dispatch-operation-priv.h b/src/mcd-dispatch-operation-priv.h
index b33c377..1179829 100644
--- a/src/mcd-dispatch-operation-priv.h
+++ b/src/mcd-dispatch-operation-priv.h
@@ -146,9 +146,7 @@ G_GNUC_INTERNAL void _mcd_dispatch_operation_check_client_locks (
 G_GNUC_INTERNAL void _mcd_dispatch_operation_handle_channels_cb (
     McdDispatchOperation *self, TpClient *client, const GError *error);
 
-G_GNUC_INTERNAL void _mcd_dispatch_operation_run_observers (
-    McdDispatchOperation *self);
-G_GNUC_INTERNAL void _mcd_dispatch_operation_run_approvers (
+G_GNUC_INTERNAL void _mcd_dispatch_operation_run_clients (
     McdDispatchOperation *self);
 
 G_END_DECLS
diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c
index adde700..6687a49 100644
--- a/src/mcd-dispatch-operation.c
+++ b/src/mcd-dispatch-operation.c
@@ -1508,7 +1508,7 @@ collect_satisfied_requests (GList *channels)
     return ret;
 }
 
-void
+static void
 _mcd_dispatch_operation_run_observers (McdDispatchOperation *self)
 {
     const GList *cl;
@@ -1620,16 +1620,13 @@ add_dispatch_operation_cb (TpClient *proxy,
     _mcd_dispatch_operation_dec_ado_pending (self);
 }
 
-void
+static void
 _mcd_dispatch_operation_run_approvers (McdDispatchOperation *self)
 {
     const GList *cl;
     GHashTableIter iter;
     gpointer client_p;
 
-    g_return_if_fail (MCD_IS_DISPATCH_OPERATION (self));
-    g_return_if_fail (_mcd_dispatch_operation_needs_approval (self));
-
     /* we temporarily increment this count and decrement it at the end of the
      * function, to make sure it won't become 0 while we are still invoking
      * approvers */
@@ -1688,3 +1685,27 @@ _mcd_dispatch_operation_run_approvers (McdDispatchOperation *self)
      * function */
     _mcd_dispatch_operation_dec_ado_pending (self);
 }
+
+void
+_mcd_dispatch_operation_run_clients (McdDispatchOperation *self)
+{
+    _mcd_dispatch_operation_run_observers (self);
+
+    /* if the dispatch operation thinks the channels were not
+     * requested, start the Approvers */
+    if (_mcd_dispatch_operation_needs_approval (self))
+    {
+        /* but if the handlers have the BypassApproval flag set, then don't
+         *
+         * FIXME: we should really run BypassApproval handlers as a separate
+         * stage, rather than considering the existence of a BypassApproval
+         * handler to constitute approval - this is fd.o #23687 */
+        if (_mcd_dispatch_operation_handlers_can_bypass_approval (self))
+            _mcd_dispatch_operation_set_approved (self);
+
+        if (!_mcd_dispatch_operation_is_approved (self))
+            _mcd_dispatch_operation_run_approvers (self);
+    }
+
+    _mcd_dispatch_operation_set_invoked_early_clients (self);
+}
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index ebfa9da..80ec3ac 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -668,37 +668,6 @@ finally:
     mcd_dispatcher_context_unref (context, "CTXREF04");
 }
 
-/* Happens at the end of successful filter chain execution (empty chain
- * is always successful)
- */
-static void
-mcd_dispatcher_run_clients (McdDispatcherContext *context)
-{
-    mcd_dispatcher_context_ref (context, "CTXREF07");
-
-    _mcd_dispatch_operation_run_observers (context->operation);
-
-    /* if the dispatch operation thinks the channels were not
-     * requested, start the Approvers */
-    if (_mcd_dispatch_operation_needs_approval (context->operation))
-    {
-        /* but if the handlers have the BypassApproval flag set, then don't
-         *
-         * FIXME: we should really run BypassApproval handlers as a separate
-         * stage, rather than considering the existence of a BypassApproval
-         * handler to constitute approval - this is fd.o #23687 */
-        if (_mcd_dispatch_operation_handlers_can_bypass_approval
-            (context->operation))
-            _mcd_dispatch_operation_set_approved (context->operation);
-
-        if (!_mcd_dispatch_operation_is_approved (context->operation))
-            _mcd_dispatch_operation_run_approvers (context->operation);
-    }
-
-    _mcd_dispatch_operation_set_invoked_early_clients (context->operation);
-    mcd_dispatcher_context_unref (context, "CTXREF07");
-}
-
 /*
  * _mcd_dispatcher_context_abort:
  *
@@ -1386,7 +1355,7 @@ mcd_dispatcher_context_proceed (McdDispatcherContext *context)
         return;
     }
 
-    mcd_dispatcher_run_clients (context);
+    _mcd_dispatch_operation_run_clients (context->operation);
 
 no_more:
     mcd_dispatcher_context_unref (context, "CTXREF01");
-- 
1.5.6.5




More information about the telepathy-commits mailing list