Patch by Jaehun Lim <ljaehun.lim@samsung.com> on 2011-07-14
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Jul 2011 06:07:29 +0000 (06:07 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Jul 2011 06:07:29 +0000 (06:07 +0000)
Reviewed by Adam Barth.

[EFL] Remove IconDatabase initialization in _ewk_init_body()
https://bugs.webkit.org/show_bug.cgi?id=63491

Make IconDatabase feature optional by removing its initialization from _ewk_init_body().
Now IconDatabase must be fully managed by an application:
if it doesn't want to use it, there's nothing to do. Otherwise, just call
ewk_settings_icon_database_path_set() with the directory path.

* ewk/ewk_main.cpp:
(_ewk_init_body):
* ewk/ewk_settings.cpp:
(ewk_settings_icon_database_path_set):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@91051 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/efl/ChangeLog
Source/WebKit/efl/ewk/ewk_main.cpp
Source/WebKit/efl/ewk/ewk_settings.cpp

index 13d908b7fe602e1503cf7c7fda2aa24145d20433..683a417608782e82938bf8e713d701fbd02dee43 100755 (executable)
@@ -1,3 +1,20 @@
+2011-07-14  Jaehun Lim  <ljaehun.lim@samsung.com>
+
+        Reviewed by Adam Barth.
+
+        [EFL] Remove IconDatabase initialization in _ewk_init_body()
+        https://bugs.webkit.org/show_bug.cgi?id=63491
+
+        Make IconDatabase feature optional by removing its initialization from _ewk_init_body().
+        Now IconDatabase must be fully managed by an application:
+        if it doesn't want to use it, there's nothing to do. Otherwise, just call
+        ewk_settings_icon_database_path_set() with the directory path.
+
+        * ewk/ewk_main.cpp:
+        (_ewk_init_body):
+        * ewk/ewk_settings.cpp:
+        (ewk_settings_icon_database_path_set):
+
 2011-07-12  Joseph Pecoraro  <joepeck@webkit.org>
 
         ApplicationCache update should not immediately fail when reaching per-origin quota
index 80dfc88171fd9e6696cfed52cbf3dcb2d9ed10c6..751955b0d660a46906fa2302cabc269b208fb905 100644 (file)
@@ -198,7 +198,6 @@ Eina_Bool _ewk_init_body(void)
     WTF::String wkdir = home + "/.webkit";
     if (WebCore::makeAllDirectories(wkdir)) {
         ewk_settings_web_database_path_set(wkdir.utf8().data());
-        ewk_settings_icon_database_path_set(wkdir.utf8().data());
 
 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
         ewk_settings_cache_directory_path_set(wkdir.utf8().data());
index 23504f2c968dd1287ac1d9b985800ca80fc7ebc9..845d1469df416679da6351383a4ad6470245cbe9 100644 (file)
@@ -140,6 +140,9 @@ const char *ewk_settings_web_database_path_get(void)
 /**
  * Sets directory where to store icon database, opening or closing database.
  *
+ * Icon database must be opened only once. If you try to set a path when the icon
+ * database is already open, this function returns @c EINA_FALSE.
+ *
  * @param directory where to store icon database, must be
  *        write-able, if @c 0 is given, then database is closed
  *
@@ -150,6 +153,11 @@ Eina_Bool ewk_settings_icon_database_path_set(const char *directory)
     WebCore::IconDatabase::delayDatabaseCleanup();
 
     if (directory) {
+        if (WebCore::iconDatabase().isEnabled()) {
+            ERR("IconDatabase is already open: %s", _ewk_icon_database_path);
+            return EINA_FALSE;
+        }
+
         struct stat st;
 
         if (stat(directory, &st)) {