1) Fixed a crash of adding bookmark. 06/42606/1 accepted/tizen/tv/20150701.001505 submit/tizen/20150630.125137
authorJung Ick Guack <ji.guack@samsung.com>
Tue, 30 Jun 2015 12:37:15 +0000 (21:37 +0900)
committerJung Ick Guack <ji.guack@samsung.com>
Tue, 30 Jun 2015 12:40:44 +0000 (21:40 +0900)
   (Added null checking)
2) Added privilege for using browser-provider

Change-Id: I2c9c8b4208e9d1ff7b951419fad15ed404a170bb
Signed-off-by: Jung Ick Guack <ji.guack@samsung.com>
manifest.xml.in
services/BookmarkService/BookmarkService.cpp

index b8756da..8c4c7f1 100644 (file)
@@ -73,4 +73,8 @@
                        <mime name="application/xml" />
                </application-service>
     </ui-application>
+    <privileges>
+       <privilege>http://tizen.org/privilege/bookmark.admin</privilege>
+       <privilege>http://tizen.org/privilege/history.admin</privilege>
+    </privileges>
 </manifest>
index 2fd0bf7..99b14e2 100644 (file)
@@ -97,14 +97,16 @@ std::shared_ptr<BookmarkItem> BookmarkService::addToBookmarks(
     bp_bookmark_adaptor_set_url(bookmark_id, address.c_str());
 
     bp_bookmark_adaptor_set_title(bookmark_id, tittle.c_str());
-
-    std::unique_ptr<tizen_browser::tools::Blob> thumb_blob = tizen_browser::tools::EflTools::getBlobPNG(thumbnail);
-    unsigned char * thumb = std::move((unsigned char*)thumb_blob->getData());
-    bp_bookmark_adaptor_set_snapshot(bookmark_id, thumbnail->width, thumbnail->height, thumb, thumb_blob->getLength());
-
-    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_bookmark_adaptor_set_icon(bookmark_id, favicon->width, favicon->height, fav, favicon_blob->getLength());
+       if (thumbnail) {
+           std::unique_ptr<tizen_browser::tools::Blob> thumb_blob = tizen_browser::tools::EflTools::getBlobPNG(thumbnail);
+           unsigned char * thumb = std::move((unsigned char*)thumb_blob->getData());
+           bp_bookmark_adaptor_set_snapshot(bookmark_id, thumbnail->width, thumbnail->height, thumb, thumb_blob->getLength());
+       }
+       if (favicon) {
+           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_bookmark_adaptor_set_icon(bookmark_id, favicon->width, favicon->height, fav, favicon_blob->getLength());
+       }
 
     m_bookmarks.push_back(bookmark);
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);