+void HistoryService::addHistoryItem(std::shared_ptr<HistoryItem> his){
+
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+ his->setFavIcon(his->getFavIcon());
+ std::shared_ptr<tizen_browser::tools::BrowserImage> favicon = his->getFavIcon();
+
+ int id = -1;
+ int ret = bp_history_adaptor_create(&id);
+ if (ret<0){
+ BROWSER_LOGE("Error! Could not create new bookmark!");
+ }
+
+ int *ids=NULL;
+ int count=-1;
+ int **id1=&ids;
+ int *count1=&count;
+
+ bp_history_rows_cond_fmt conds;
+ conds.limit = 20; //no of rows to get negative means no limitation
+
+ conds.offset = -1; //the first row's index
+ conds.order_offset =BP_HISTORY_O_DATE_CREATED; // property to sort
+
+ conds.ordering = 1; //way of ordering 0 asc 1 desc
+
+ conds.period_offset = BP_HISTORY_O_DATE_CREATED;
+ conds.period_type = BP_HISTORY_DATE_TODAY;
+
+ ret = bp_history_adaptor_get_cond_ids_p(id1 ,count1, &conds, 0, NULL, 0);
+ if (ret<0){
+ BROWSER_LOGE("Error! Could not get ids!");
+ }
+
+ bp_history_adaptor_set_url(id, (his->getUrl()).c_str());
+ bp_history_adaptor_set_title(id, (his->getTitle()).c_str());
+
+
+ std::unique_ptr<tizen_browser::tools::Blob> favicon_blob = tizen_browser::tools::EflTools::getBlobPNG(favicon);
+ unsigned char * fav = std::move((unsigned char*)favicon_blob->getData());
+ bp_history_adaptor_set_icon(id, favicon->width, favicon->height, fav, favicon_blob->getLength());
+
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+}
+
+