Revert "eldbus: change to idle_enterer from idler" 31/167031/3
authorShinwoo Kim <cinoo.kim@samsung.com>
Mon, 15 Jan 2018 05:21:53 +0000 (14:21 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Mon, 15 Jan 2018 05:56:00 +0000 (14:56 +0900)
This reverts commit 10eb4c9a6b62558fb0b7d61d6c0442acad672278.

※ Reason: request of profile team, because of GEM usage

@tizen_fix

Change-Id: I650f32524683b1d2455810d050ba70cc67584e20

src/lib/eldbus/eldbus_core.c
src/lib/eldbus/eldbus_private_types.h
src/lib/eldbus/eldbus_service.c

index c9ed990..638595a 100644 (file)
@@ -45,7 +45,7 @@ typedef struct _Eldbus_Connection_Context_NOC_Cb
    Eldbus_Name_Owner_Changed_Cb cb;
    const void                 *cb_data;
    Eina_Bool                   deleted : 1;
-   Ecore_Idle_Enterer         *idle_enterer;
+   Ecore_Idler                *idler;
    Eina_Bool                   allow_initial : 1;
 } Eldbus_Connection_Context_NOC_Cb;
 
@@ -771,7 +771,7 @@ cb_timeout_toggle(DBusTimeout *timeout, void *data EINA_UNUSED)
 }
 
 static Eina_Bool
-eldbus_idle_enterer(void *data)
+eldbus_idler(void *data)
 {
    Eldbus_Connection *conn = data;
 
@@ -781,22 +781,15 @@ eldbus_idle_enterer(void *data)
    if (dbus_connection_get_dispatch_status(conn->dbus_conn) ==
        DBUS_DISPATCH_COMPLETE)
      {
-        DBG("Connection@%p: Dispatch complete, idle_enterer@%p finishing",
-            conn, conn->idle_enterer);
-        conn->idle_enterer = NULL;
+        DBG("Connection@%p: Dispatch complete, idler@%p finishing",
+            conn, conn->idler);
+        conn->idler = NULL;
         return ECORE_CALLBACK_CANCEL;
      }
    DBG("Connection@%p: Dispatching", conn);
    eldbus_init();
    eldbus_connection_ref(conn);
-
-   DBusDispatchStatus status;
-   do
-     {
-        status = dbus_connection_dispatch(conn->dbus_conn);
-     }
-   while(status == DBUS_DISPATCH_DATA_REMAINS);
-
+   dbus_connection_dispatch(conn->dbus_conn);
    eldbus_connection_unref(conn);
    eldbus_shutdown();
    return ECORE_CALLBACK_RENEW;
@@ -815,19 +808,19 @@ cb_dispatch_status(DBusConnection *dbus_conn EINA_UNUSED, DBusDispatchStatus new
 
    DBG("Connection@%p: Dispatch status: %d", conn, new_status);
 
-   if ((new_status == DBUS_DISPATCH_DATA_REMAINS) && (!conn->idle_enterer))
+   if ((new_status == DBUS_DISPATCH_DATA_REMAINS) && (!conn->idler))
      {
-        conn->idle_enterer = ecore_idle_enterer_add(eldbus_idle_enterer, conn);
-        DBG("Connection@%p: Adding idle_enterer@%p to handle remaining dispatch data",
-            conn, conn->idle_enterer);
+        conn->idler = ecore_idler_add(eldbus_idler, conn);
+        DBG("Connection@%p: Adding idler@%p to handle remaining dispatch data",
+            conn, conn->idler);
      }
-   else if ((new_status != DBUS_DISPATCH_DATA_REMAINS) && (conn->idle_enterer))
+   else if ((new_status != DBUS_DISPATCH_DATA_REMAINS) && (conn->idler))
      {
-        DBG("Connection@%p: No remaining dispatch data, clearing idle_enterer@%p",
-            conn, conn->idle_enterer);
+        DBG("Connection@%p: No remaining dispatch data, clearing idler@%p",
+            conn, conn->idler);
 
-        ecore_idle_enterer_del(conn->idle_enterer);
-        conn->idle_enterer = NULL;
+        ecore_idler_del(conn->idler);
+        conn->idler = NULL;
      }
 }
 
@@ -1263,7 +1256,7 @@ _eldbus_connection_free(Eldbus_Connection *conn)
 
    eldbus_data_del_all(&conn->data);
 
-   if (conn->idle_enterer) ecore_idle_enterer_del(conn->idle_enterer);
+   if (conn->idler) ecore_idler_del(conn->idler);
    if (conn->type && conn->shared)
      {
         if (conn->type == ELDBUS_CONNECTION_TYPE_ADDRESS)
@@ -1361,7 +1354,7 @@ dispach_name_owner_cb(void *context)
    dispatch_name_owner_data *data = context;
    data->ctx->cb((void *)data->ctx->cb_data, data->cn->name, "",
                  data->cn->unique_id);
-   data->ctx->idle_enterer = NULL;
+   data->ctx->idler = NULL;
    free(data);
    return ECORE_CALLBACK_CANCEL;
 }
@@ -1393,7 +1386,7 @@ eldbus_name_owner_changed_callback_add(Eldbus_Connection *conn, const char *bus,
         EINA_SAFETY_ON_NULL_RETURN(dispatch_data);
         dispatch_data->cn = cn;
         dispatch_data->ctx = ctx;
-        ctx->idle_enterer = ecore_idle_enterer_add(dispach_name_owner_cb, dispatch_data);
+        ctx->idler = ecore_idler_add(dispach_name_owner_cb, dispatch_data);
      }
    return;
 
@@ -1436,10 +1429,10 @@ eldbus_name_owner_changed_callback_del(Eldbus_Connection *conn, const char *bus,
 
    cn->event_handlers.list = eina_inlist_remove(cn->event_handlers.list,
                                                 EINA_INLIST_GET(found));
-   if (found->idle_enterer)
+   if (found->idler)
      {
         dispatch_name_owner_data *data;
-        data = ecore_idle_enterer_del(found->idle_enterer);
+        data = ecore_idler_del(found->idler);
         free(data);
      }
    free(found);
index 05dfee8..7af9426 100644 (file)
@@ -54,7 +54,7 @@ struct _Eldbus_Connection
    Eina_Inlist                   *pendings;
    Eina_Inlist                   *fd_handlers;
    Eina_Inlist                   *timeouts;
-   Ecore_Idle_Enterer            *idle_enterer;
+   Ecore_Idler                   *idler;
    Eldbus_Connection_Context_Event event_handlers[ELDBUS_CONNECTION_EVENT_LAST];
    Eina_Inlist                   *root_objs;//service_object
    Eldbus_Proxy                   *fdo_proxy;
@@ -153,7 +153,7 @@ struct _Eldbus_Service_Object
    Eldbus_Service_Interface *objmanager;
    Eina_List *iface_added;
    Eina_List *iface_removed;
-   Ecore_Idle_Enterer *idle_enterer_iface_changed;
+   Ecore_Idler *idler_iface_changed;
 };
 
 struct _Eldbus_Service_Interface
@@ -167,7 +167,7 @@ struct _Eldbus_Service_Interface
    Eina_Hash *properties;
    Eldbus_Property_Set_Cb set_func;
    Eldbus_Property_Get_Cb get_func;
-   Ecore_Idle_Enterer *idle_enterer_propschanged;
+   Ecore_Idler *idler_propschanged;
    Eina_Array *props_changed;
    Eina_Array *prop_invalidated;
 };
index 39f2a29..9fdcdd5 100644 (file)
@@ -784,7 +784,7 @@ _object_manager_changes_process(void *data)
    Eldbus_Service_Object *obj = data;
    Eldbus_Service_Object *parent = _object_manager_parent_find(obj);
 
-   obj->idle_enterer_iface_changed = NULL;
+   obj->idler_iface_changed = NULL;
 
    if (!parent)
      {
@@ -823,8 +823,8 @@ _eldbus_service_interface_add(Eldbus_Service_Object *obj, const char *interface)
    iface->obj = obj;
    eina_hash_add(obj->interfaces, iface->name, iface);
 
-   if (!obj->idle_enterer_iface_changed)
-     obj->idle_enterer_iface_changed = ecore_idle_enterer_add(_object_manager_changes_process,
+   if (!obj->idler_iface_changed)
+     obj->idler_iface_changed = ecore_idler_add(_object_manager_changes_process,
                                                 obj);
    obj->iface_added = eina_list_append(obj->iface_added, iface);
 
@@ -1016,7 +1016,7 @@ eldbus_service_interface_fallback_register2(Eldbus_Connection *conn, const char
 }
 
 static Eina_Bool
-_idle_enterer_propschanged(void *data)
+_idler_propschanged(void *data)
 {
    Eldbus_Service_Interface *iface = data;
    Eldbus_Message *msg;
@@ -1024,7 +1024,7 @@ _idle_enterer_propschanged(void *data)
    Eina_Hash *added = NULL;
    Property *prop;
 
-   iface->idle_enterer_propschanged = NULL;
+   iface->idler_propschanged = NULL;
 
    added = eina_hash_string_small_new(NULL);
    msg = eldbus_message_signal_new(iface->obj->path, properties_iface->name,
@@ -1128,10 +1128,10 @@ _interface_free(Eldbus_Service_Interface *interface)
    /**
     * flush props changes before remove interface
     */
-   if (interface->idle_enterer_propschanged)
+   if (interface->idler_propschanged)
      {
-        ecore_idle_enterer_del(interface->idle_enterer_propschanged);
-        _idle_enterer_propschanged(interface);
+        ecore_idler_del(interface->idler_propschanged);
+        _idler_propschanged(interface);
      }
 
    eina_hash_free(interface->methods);
@@ -1151,17 +1151,17 @@ _interface_free(Eldbus_Service_Interface *interface)
         /* Adding and removing the interface in the same main loop iteration.
          * Let's not send any signal */
         obj->iface_added = eina_list_remove_list(obj->iface_added, l);
-        if (!obj->iface_added && !obj->iface_removed && obj->idle_enterer_iface_changed)
+        if (!obj->iface_added && !obj->iface_removed && obj->idler_iface_changed)
           {
-             ecore_idle_enterer_del(obj->idle_enterer_iface_changed);
-             obj->idle_enterer_iface_changed = NULL;
+             ecore_idler_del(obj->idler_iface_changed);
+             obj->idler_iface_changed = NULL;
           }
      }
    else
      {
-        if (!obj->idle_enterer_iface_changed)
+        if (!obj->idler_iface_changed)
           {
-             obj->idle_enterer_iface_changed = ecore_idle_enterer_add(
+             obj->idler_iface_changed = ecore_idler_add(
                 _object_manager_changes_process, obj);
           }
 
@@ -1188,9 +1188,9 @@ static void _children_ifaces_add_removed_flush(Eldbus_Service_Object *obj)
           _children_ifaces_add_removed_flush(children);
      }
 
-   if (obj->idle_enterer_iface_changed)
+   if (obj->idler_iface_changed)
      {
-        ecore_idle_enterer_del(obj->idle_enterer_iface_changed);
+        ecore_idler_del(obj->idler_iface_changed);
         _object_manager_changes_process(obj);
      }
 }
@@ -1221,9 +1221,9 @@ _object_free(Eldbus_Service_Object *obj)
     * Flush our iface_add/removed if this object are
     * children of some other path with ObjectManager
     */
-   if (obj->idle_enterer_iface_changed)
+   if (obj->idler_iface_changed)
      {
-        ecore_idle_enterer_del(obj->idle_enterer_iface_changed);
+        ecore_idler_del(obj->idler_iface_changed);
         _object_manager_changes_process(obj);
      }
 
@@ -1482,8 +1482,8 @@ eldbus_service_property_changed(const Eldbus_Service_Interface *interface, const
    prop = eina_hash_find(iface->properties, name);
    EINA_SAFETY_ON_NULL_RETURN_VAL(prop, EINA_FALSE);
 
-   if (!iface->idle_enterer_propschanged)
-     iface->idle_enterer_propschanged = ecore_idle_enterer_add(_idle_enterer_propschanged, iface);
+   if (!iface->idler_propschanged)
+     iface->idler_propschanged = ecore_idler_add(_idler_propschanged, iface);
    if (!iface->props_changed)
      iface->props_changed = eina_array_new(1);
 
@@ -1507,8 +1507,8 @@ eldbus_service_property_invalidate_set(const Eldbus_Service_Interface *interface
 
    prop->is_invalidate = is_invalidate;
 
-   if (!iface->idle_enterer_propschanged)
-     iface->idle_enterer_propschanged = ecore_idle_enterer_add(_idle_enterer_propschanged, iface);
+   if (!iface->idler_propschanged)
+     iface->idler_propschanged = ecore_idler_add(_idler_propschanged, iface);
 
    if (is_invalidate)
      {
@@ -1546,8 +1546,8 @@ eldbus_service_object_manager_attach(Eldbus_Service_Interface *iface)
     * with path equal to our path rather than from the previous
     * ObjectManager
     */
-   if (obj->idle_enterer_iface_changed)
-     ecore_idle_enterer_del(obj->idle_enterer_iface_changed);
+   if (obj->idler_iface_changed)
+     ecore_idler_del(obj->idler_iface_changed);
    _object_manager_changes_process(obj);
 
    obj->objmanager = objmanager;