Refactored object cache
authorTomasz Olszak <t.olszak@samsung.com>
Tue, 14 Jul 2015 09:20:18 +0000 (11:20 +0200)
committerTomasz Olszak <t.olszak@samsung.com>
Tue, 14 Jul 2015 09:20:18 +0000 (11:20 +0200)
Now we do not perform object_cache_build_asyng till the end.
When we get new object_cache_build_async request we end ongoing
cache build and start new. This prevents some event flood case which
result in blocking event loop untill all events are processed.

Change-Id: Icb1c8b9c742709f94e0af756faba3036e73b8e44
Signed-off-by: Tomasz Olszak <t.olszak@samsung.com>
include/object_cache.h
src/object_cache.c

index 55083c3..7e1880d 100644 (file)
@@ -13,17 +13,6 @@ typedef struct
 typedef void (*ObjectCacheReadyCb)(void *data);
 
 /**
- * @brief Recursivly build ObjectCache structures for root Accessible
- * object from and its descendants. (Children's children also, etc.)
- *
- * @param root starting object.
- *
- * @remarks This function may block main-loop for significant ammount of time.
- *          Flushes all previously cached items.
- */
-void object_cache_build(AtspiAccessible *root);
-
-/**
  * @brief Recursivly build ObjectCache structures for ever Accessible
  * object from root and its all descendants.
  *
index 3051847..30fe6f7 100644 (file)
@@ -157,26 +157,6 @@ _object_cache_new(void)
    return eina_hash_pointer_new(_cache_item_free_cb);
 }
 
-void
-object_cache_build(AtspiAccessible *root)
-{
-   DEBUG("START");
-   Eina_List *objs;
-
-   _object_cache_free_internal();
-   cache = _object_cache_new();
-   if (!cache)
-      {
-         ERROR("ObjectCache: hash table creation failed");
-         return;
-      }
-
-   objs = _cache_candidates_list_prepare(root);
-   _cache_item_n_cache(objs, eina_list_count(objs));
-
-   return;
-}
-
 static Eina_Bool
 _do_cache(void *data)
 {
@@ -194,11 +174,7 @@ void
 object_cache_build_async(AtspiAccessible *root, int bulk_size, ObjectCacheReadyCb cb, void *ud)
 {
    DEBUG("START");
-   if (idler)
-      {
-         ERROR("Invalid usage. Async cache build is ongoing...");
-         return;
-      }
+
    _object_cache_free_internal();
 
    callback = cb;