Title: [131602] trunk/Source/WebKit2
Revision
131602
Author
[email protected]
Date
2012-10-17 08:36:06 -0700 (Wed, 17 Oct 2012)

Log Message

[EFL][WK2] Make sure the favicon database path is set only once
https://bugs.webkit.org/show_bug.cgi?id=99597

Patch by Christophe Dumez <[email protected]> on 2012-10-17
Reviewed by Kenneth Rohde Christiansen.

Make sure the icon database path is set only once by checking
that the database is not already open before settign the path.
This avoids printing error message on stderr.

* UIProcess/API/efl/ewk_context.cpp:
(ewk_context_favicon_database_get):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (131601 => 131602)


--- trunk/Source/WebKit2/ChangeLog	2012-10-17 15:35:59 UTC (rev 131601)
+++ trunk/Source/WebKit2/ChangeLog	2012-10-17 15:36:06 UTC (rev 131602)
@@ -1,3 +1,17 @@
+2012-10-17  Christophe Dumez  <[email protected]>
+
+        [EFL][WK2] Make sure the favicon database path is set only once
+        https://bugs.webkit.org/show_bug.cgi?id=99597
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Make sure the icon database path is set only once by checking
+        that the database is not already open before settign the path.
+        This avoids printing error message on stderr.
+
+        * UIProcess/API/efl/ewk_context.cpp:
+        (ewk_context_favicon_database_get):
+
 2012-10-17  Carlos Garcia Campos  <[email protected]>
 
         [GTK] Don't use the C API internally in WebKitWebInspector

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp (131601 => 131602)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp	2012-10-17 15:35:59 UTC (rev 131601)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp	2012-10-17 15:36:06 UTC (rev 131602)
@@ -30,6 +30,7 @@
 #include "WKRetainPtr.h"
 #include "WKString.h"
 #include "WebContext.h"
+#include "WebIconDatabase.h"
 #include "ewk_context_download_client_private.h"
 #include "ewk_context_history_client_private.h"
 #include "ewk_context_private.h"
@@ -166,12 +167,14 @@
     EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
 
     if (!ewkContext->faviconDatabase) {
-        // Set database path.
-        WebContext* webContext = toImpl(ewkContext->context.get());
-        String databasePath = webContext->iconDatabasePath() + "/" + WebCore::IconDatabase::defaultDatabaseFilename();
-        webContext->setIconDatabasePath(databasePath);
-
-        const_cast<Ewk_Context*>(ewkContext)->faviconDatabase = Ewk_Favicon_Database::create(WKContextGetIconDatabase(ewkContext->context.get()));
+        WKRetainPtr<WKIconDatabaseRef> iconDatabase = WKContextGetIconDatabase(ewkContext->context.get());
+        // Set the database path if it is not open yet.
+        if (!toImpl(iconDatabase.get())->isOpen()) {
+            WebContext* webContext = toImpl(ewkContext->context.get());
+            String databasePath = webContext->iconDatabasePath() + "/" + WebCore::IconDatabase::defaultDatabaseFilename();
+            webContext->setIconDatabasePath(databasePath);
+        }
+        const_cast<Ewk_Context*>(ewkContext)->faviconDatabase = Ewk_Favicon_Database::create(iconDatabase.get());
     }
 
     return ewkContext->faviconDatabase.get();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to