Title: [111698] trunk/Source/WebKit/gtk
Revision
111698
Author
[email protected]
Date
2012-03-22 08:05:41 -0700 (Thu, 22 Mar 2012)

Log Message

[GTK] icon database requests not dispatched until new data arrives
https://bugs.webkit.org/show_bug.cgi?id=81665

Reviewed by Martin Robinson.

Wait for the import to finish before reporting that the favicon
cache does not have a pixbuf for an URL.

Changes already covered by the favicon database unit tests.

* webkit/webkitfavicondatabase.cpp:
(webkit_favicon_database_get_favicon_pixbuf):

Modified Paths

Diff

Modified: trunk/Source/WebKit/gtk/ChangeLog (111697 => 111698)


--- trunk/Source/WebKit/gtk/ChangeLog	2012-03-22 15:04:38 UTC (rev 111697)
+++ trunk/Source/WebKit/gtk/ChangeLog	2012-03-22 15:05:41 UTC (rev 111698)
@@ -1,3 +1,18 @@
+2012-03-22  Sergio Villar Senin  <[email protected]>
+
+        [GTK] icon database requests not dispatched until new data arrives
+        https://bugs.webkit.org/show_bug.cgi?id=81665
+
+        Reviewed by Martin Robinson.
+
+        Wait for the import to finish before reporting that the favicon
+        cache does not have a pixbuf for an URL.
+
+        Changes already covered by the favicon database unit tests.
+
+        * webkit/webkitfavicondatabase.cpp:
+        (webkit_favicon_database_get_favicon_pixbuf):
+
 2012-03-22  Carlos Garcia Campos  <[email protected]>
 
         [GTK] Use the angle-bracket form to include wtf headers

Modified: trunk/Source/WebKit/gtk/webkit/webkitfavicondatabase.cpp (111697 => 111698)


--- trunk/Source/WebKit/gtk/webkit/webkitfavicondatabase.cpp	2012-03-22 15:04:38 UTC (rev 111697)
+++ trunk/Source/WebKit/gtk/webkit/webkitfavicondatabase.cpp	2012-03-22 15:05:41 UTC (rev 111698)
@@ -521,8 +521,10 @@
     GRefPtr<GSimpleAsyncResult> result = adoptGRef(g_simple_async_result_new(G_OBJECT(database), callback, userData,
                                                                              reinterpret_cast<gpointer>(webkit_favicon_database_get_favicon_pixbuf)));
 
-    // If we don't have an icon for the given URI return ASAP.
-    if (database->priv->importFinished && iconDatabase().synchronousIconURLForPageURL(String::fromUTF8(pageURI)).isEmpty()) {
+    // If we don't have an icon for the given URI or the database is not opened then return ASAP. We have to check that
+    // because if the database is not opened it will skip (and not notify about) every single icon load request
+    if ((database->priv->importFinished && iconDatabase().synchronousIconURLForPageURL(String::fromUTF8(pageURI)).isEmpty())
+        || !iconDatabase().isOpen()) {
         g_simple_async_result_set_op_res_gpointer(result.get(), 0, 0);
         g_simple_async_result_complete_in_idle(result.get());
         return;
@@ -536,11 +538,11 @@
     ASSERT(icons);
     icons->append(adoptPtr(request));
 
+    // We ask for the icon directly. If we don't get the icon data now,
+    // we'll be notified later (even if the database is still importing icons).
     GdkPixbuf* pixbuf = getIconPixbufSynchronously(database, pageURL, IntSize(width, height));
-    if (!pixbuf && !database->priv->importFinished) {
-        // Initial import is ongoing, the icon data will be available later.
+    if (!pixbuf)
         return;
-    }
 
     request->asyncResultCompleteInIdle(pixbuf);
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to