Commit 39c67af8 authored by sergio@webkit.org's avatar sergio@webkit.org
Browse files

[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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@111698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 82e1c364
2012-03-22 Sergio Villar Senin <svillar@igalia.com>
[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 <cgarcia@bb-webkit-rel-64.local.igalia.com>
 
[GTK] Use the angle-bracket form to include wtf headers
......
......@@ -521,8 +521,10 @@ void webkit_favicon_database_get_favicon_pixbuf(WebKitFaviconDatabase* database,
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 @@ void webkit_favicon_database_get_favicon_pixbuf(WebKitFaviconDatabase* database,
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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment