From: Sung-jae Park Date: Mon, 18 Nov 2013 04:22:18 +0000 (+0900) Subject: Consuming pended update request. X-Git-Tag: submit/tizen_mobile/20150512.125148^2~1^2~15^2~9^2~101 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=919b5976d50a3d20584219a4c236893e033bb749;p=platform%2Fcore%2Fappfw%2Fdata-provider-slave.git Consuming pended update request. When it gets resume event, if it exceed the update period, consuming the pended update request and update the box. Change-Id: Ie733da7b4675d3d96ba771696efa8726ab26e4fc --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 578b232..45b02e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,6 +53,7 @@ ADD_DEFINITIONS("-DNDEBUG") ADD_DEFINITIONS("-DLOG_TAG=\"DATA_PROVIDER_SLAVE\"") ADD_DEFINITIONS("-D_USE_ECORE_TIME_GET") #ADD_DEFINITIONS("-D_LOOP_DETECTOR") +#ADD_DEFINITIONS("-D_ESTIMATE_PERF") ADD_DEFINITIONS(${pkg_CFLAGS}) diff --git a/packaging/com.samsung.data-provider-slave.spec b/packaging/com.samsung.data-provider-slave.spec index 4f9d342..db3791e 100644 --- a/packaging/com.samsung.data-provider-slave.spec +++ b/packaging/com.samsung.data-provider-slave.spec @@ -2,7 +2,7 @@ Name: com.samsung.data-provider-slave Summary: Plugin type livebox service provider -Version: 0.12.19 +Version: 0.12.20 Release: 1 Group: HomeTF/Livebox License: Flora License diff --git a/src/lb.c b/src/lb.c index 3eccfa5..0a5c960 100644 --- a/src/lb.c +++ b/src/lb.c @@ -36,6 +36,14 @@ #include "fault.h" #include "util.h" +#if defined(_ESTIMATE_PERF) +#define ESTIMATE_START(id) DbgPrint("%s START\n", id); +#define ESTIMATE_END(id) DbgPrint("%s END\n", id); +#else +#define ESTIMATE_START(id) +#define ESTIMATE_END(id) +#endif + #define IS_LB_SHOWN(itm) (!(itm)->inst->item->has_livebox_script || ((itm)->inst->item->has_livebox_script && (itm)->is_lb_show)) int errno; @@ -377,6 +385,26 @@ static inline void migrate_to_pending_list_from_hidden_list(struct item *item) append_pending_list(item); } +static inline int clear_from_pending_list(struct item *item) +{ + Eina_List *l; + struct item *tmp; + + EINA_LIST_FOREACH(s_info.pending_list, l, tmp) { + if (tmp != item) { + continue; + } + + s_info.pending_list = eina_list_remove_list(s_info.pending_list, l); + if (!s_info.pending_list) { + deactivate_pending_consumer(); + } + return LB_STATUS_SUCCESS; + } + + return LB_STATUS_ERROR_NOT_EXIST; +} + /*! * \brief * This function can call the update callback @@ -408,6 +436,13 @@ static inline int timer_thaw(struct item *item) item->sleep_at = 0.0f; if (sleep_time > pending) { + + /*! + * Before do updating forcely, clear it from the pending list. + * We will consume it from here now. + */ + (void)clear_from_pending_list(item); + if (updator_cb(item) == ECORE_CALLBACK_CANCEL) { /* item is destroyed */ return UPDATE_ITEM_DELETED; @@ -629,26 +664,6 @@ static inline int clear_from_pd_open_pending_list(struct item *item) return LB_STATUS_ERROR_NOT_EXIST; } -static inline int clear_from_pending_list(struct item *item) -{ - Eina_List *l; - struct item *tmp; - - EINA_LIST_FOREACH(s_info.pending_list, l, tmp) { - if (tmp != item) { - continue; - } - - s_info.pending_list = eina_list_remove_list(s_info.pending_list, l); - if (!s_info.pending_list) { - deactivate_pending_consumer(); - } - return LB_STATUS_SUCCESS; - } - - return LB_STATUS_ERROR_NOT_EXIST; -} - static Eina_Bool update_timeout_cb(void *data) { struct item *item; @@ -1212,7 +1227,9 @@ HAPI int lb_resize(const char *pkgname, const char *id, int w, int h) item = eina_list_data_get(l); + ESTIMATE_START(id); ret = so_resize(inst, w, h); + ESTIMATE_END(id); if (ret < 0) { return ret; } @@ -1309,7 +1326,9 @@ HAPI int lb_clicked(const char *pkgname, const char *id, const char *event, doub item = eina_list_data_get(l); + ESTIMATE_START(id); ret = so_clicked(inst, event, timestamp, x, y); + ESTIMATE_END(id); if (ret < 0) { return ret; } @@ -1376,7 +1395,9 @@ HAPI int lb_script_event(const char *pkgname, const char *id, const char *emissi } } + ESTIMATE_START(id); ret = so_script_event(inst, emission, source, event_info); + ESTIMATE_END(id); if (ret < 0) { return ret; }