[Tizen][Dev] Enable favicon path in WebContentsDelegateEfl::DidFinishLoad
authorYi Shen <yi.shen@samsung.com>
Fri, 7 Nov 2014 19:22:13 +0000 (11:22 -0800)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
This patch 1) enables favicon path in DidFinishLoad() since no crash observed
anymore; 2) validates favicon before starting downloading it.

Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=7883
Reviewed by: Antonio Gomes, Piotr Tworek, commitbot

Change-Id: I89f9c0ebac94fefd72f23a13aecd23ef7caa3bd8
Signed-off-by: Yi Shen <yi.shen@samsung.com>
tizen_src/impl/web_contents_delegate_efl.cc

index c4cae08..8713ac8 100644 (file)
@@ -310,25 +310,26 @@ void WebContentsDelegateEfl::DidFinishLoad(RenderFrameHost* render_frame_host,
   DCHECK(entry);
   FaviconStatus &favicon = entry->GetFavicon();
 
-  // http://107.108.218.239/bugzilla/show_bug.cgi?id=7883
-#if !defined(EWK_BRINGUP)
-  // check/update the url and favicon url in favicon database
-  FaviconService fs;
-  fs.SetFaviconURLForPageURL(favicon.url, validated_url);
-
-  // download favicon if there is no such in database
-  if (!fs.ExistsForFaviconURL(favicon.url)) {
-    LOG(ERROR) << "[DidFinishLoad] :: no favicon in database for URL: "
-               << favicon.url.spec();
-    favicon_downloader_.reset(new FaviconDownloader(&web_contents_,
-                                                   favicon.url,
-                                                   base::Bind(&WebContentsDelegateEfl::DidDownloadFavicon,
-                                                              weak_ptr_factory_.GetWeakPtr())));
-    favicon_downloader_->Start();
-  } else {
-    web_view_->SmartCallback<EWebViewCallbacks::IconReceived>().call();
+  if (favicon.valid) {
+    // check/update the url and favicon url in favicon database
+    FaviconService fs;
+    fs.SetFaviconURLForPageURL(favicon.url, validated_url);
+
+    // download favicon if there is no such in database
+    if (!fs.ExistsForFaviconURL(favicon.url)) {
+      LOG(ERROR) << "[DidFinishLoad] :: no favicon in database for URL: "
+                 << favicon.url.spec();
+      favicon_downloader_.reset(
+        new FaviconDownloader(&web_contents_,
+                              favicon.url,
+                              base::Bind(
+                                &WebContentsDelegateEfl::DidDownloadFavicon,
+                                weak_ptr_factory_.GetWeakPtr())));
+      favicon_downloader_->Start();
+    } else {
+      web_view_->SmartCallback<EWebViewCallbacks::IconReceived>().call();
+    }
   }
-#endif
 
   web_view_->SmartCallback<EWebViewCallbacks::LoadFinished>().call();
 }