[M120 Migration] Implemention of ewk_context_icon_database_delete_all for favicon DB 74/310074/2
authorjiangyuwei <yuwei.jiang@samsung.com>
Mon, 22 Apr 2024 05:50:31 +0000 (13:50 +0800)
committerBot Blink <blinkbot@samsung.com>
Tue, 23 Apr 2024 01:45:56 +0000 (01:45 +0000)
Implement ewk_context_icon_database_delete_all api to clear favicon DB.

Reference:
 - https://review.tizen.org/gerrit/304025/

Change-Id: Ief75a66eb835350ac9b03f7807ce88a2e2b32047
Signed-off-by: jiangyuwei <yuwei.jiang@samsung.com>
tizen_src/ewk/efl_integration/eweb_context.cc
tizen_src/ewk/efl_integration/eweb_context.h
tizen_src/ewk/efl_integration/private/ewk_context_private.cc
tizen_src/ewk/efl_integration/private/ewk_context_private.h
tizen_src/ewk/efl_integration/public/ewk_context.cc

index dbe2d10f5f07d8f013105e45020428835b200dff..48c3eeb7b4fca6d5f873a828cd2af3eca6c55660 100644 (file)
@@ -820,6 +820,10 @@ bool EWebContext::SetFaviconDatabasePath(const base::FilePath& path) {
   return FaviconDatabase::Instance()->SetPath(path);
 }
 
+void EWebContext::ClearFaviconDatabase() {
+  FaviconDatabase::Instance()->Clear();
+}
+
 Evas_Object* EWebContext::AddFaviconObject(const char* uri,
                                            Evas* canvas) const {
   if (uri == NULL || canvas == NULL) {
index aadfd54119f802d271548a96738b5407fcc5fda6..545e5a77be88f3d09ea8ffcc14ea14fd292d5d66 100644 (file)
@@ -152,6 +152,7 @@ class EWebContext {
       Ewk_Local_File_System_Origins_Get_Callback callback,
       void* user_data) const;
   bool SetFaviconDatabasePath(const base::FilePath& path);
+  void ClearFaviconDatabase();
   Evas_Object *AddFaviconObject(const char *uri, Evas *canvas) const;
 
   void SetTizenAppId(const std::string& tizen_app_id);
index facb920ade79dff94314246ce81db6a4c2bba911..8782b1d4f21f58052c5d6708a596ff1c10ff69e9 100644 (file)
@@ -256,6 +256,10 @@ bool Ewk_Context::SetFaviconDatabasePath(const base::FilePath& path) {
   return impl->SetFaviconDatabasePath(path);
 }
 
+void Ewk_Context::ClearFaviconDatabase() {
+  impl->ClearFaviconDatabase();
+}
+
 EwkFaviconDatabase* Ewk_Context::GetFaviconDatabase() const {
   return impl->GetFaviconDatabase();
 }
index 33ac56af4d194cbb5fcd0d196fe76dca6683b99b..2b84c1be9ecc4710af421bdad02708a864edebe9 100644 (file)
@@ -109,6 +109,7 @@ struct Ewk_Context : public base::RefCounted<Ewk_Context> {
 
   // Favicon
   bool SetFaviconDatabasePath(const base::FilePath& path);
+  void ClearFaviconDatabase();
   Evas_Object *AddFaviconObject(const char *uri, Evas *canvas) const;
 
   // Widget
index 29209d2fad843ac9c2c5b4b38da115f4a9c39357..5630d60da9b819382157f150fc01923fefdf42a3 100644 (file)
@@ -896,7 +896,8 @@ void ewk_context_password_confirm_popup_reply(Ewk_Context* context, Ewk_Context_
 
 void ewk_context_icon_database_delete_all(Ewk_Context* context)
 {
-  LOG_EWK_API_MOCKUP();
+  EINA_SAFETY_ON_NULL_RETURN(context);
+  context->ClearFaviconDatabase();
 }
 
 Eina_Bool ewk_context_check_accessible_path_callback_set(Ewk_Context* context, Ewk_Context_Check_Accessible_Path_Callback callback, void* user_data)