fixup! Apply mime_override_callback for specific mimetype 53/106753/1
authorYoungcheol Kang <ychul.kang@samsung.com>
Wed, 21 Dec 2016 11:31:11 +0000 (20:31 +0900)
committerYoungcheol Kang <ychul.kang@samsung.com>
Fri, 23 Dec 2016 01:06:02 +0000 (10:06 +0900)
When the mime is empty, the callback should be released to prevent
the crash issue.

Bug: http://suprem.sec.samsung.net/jira/browse/TSAM-11333

Change-Id: Iaec07731e0c4a092cce161f3d39dc4bac18c2d22
Signed-off-by: Youngcheol Kang <ychul.kang@samsung.com>
runtime/browser/web_view_impl.cc

index b7d36eb..ddc4816 100644 (file)
@@ -117,6 +117,10 @@ void WebViewImpl::LoadUrl(const std::string& url, const std::string& mime) {
       return view->mime_set_cb_(url, mime, new_mime, data);
     };
     ewk_context_mime_override_callback_set(context_, mime_override_cb, this);
+  } else {
+    // In order to prevent crash issue, the callback should be released
+    // when the mime is empty.
+    ewk_context_mime_override_callback_set(context_, nullptr, nullptr);
   }
   ewk_view_url_set(ewk_view_, url.c_str());
 }