Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a388e15a572556156249eb1b97bcdf34327fe43b
https://github.com/WebKit/WebKit/commit/a388e15a572556156249eb1b97bcdf34327fe43b
Author: Adrian Perez de Castro <[email protected]>
Date: 2025-10-29 (Wed, 29 Oct 2025)
Changed paths:
M Source/WebKit/UIProcess/API/glib/IconDatabase.cpp
M Source/WebKit/UIProcess/API/glib/IconDatabase.h
M Source/WebKit/UIProcess/API/glib/WebKitFaviconDatabase.cpp
Log Message:
-----------
[GLib] Make IconDatabase handle multiple per-page icons
https://bugs.webkit.org/show_bug.cgi?id=301088
Reviewed by Carlos Garcia Campos.
The existing database schema was already able to store multiple icons
per page URL, so it was left unchanged. The pageURL->iconURL map was
being filled with the icon from the last row read from the database. The
main change was having the map use a ListHashSet to store the multiple
icon URLs for each page, then apply the needed edits in the rest of the
code that touches it to accomodate the change. Using a ListHashSet
allows keeping the order in which icon URLs were loaded from the
database to make WebKitFaviconDatabase take the last one, thus
preserving previous behaviour (for now).
* Source/WebKit/UIProcess/API/glib/IconDatabase.cpp:
(WebKit::IconDatabase::IconDatabase):
(WebKit::IconDatabase::populatePageURLToIconURLsMap): Load all fetched
rows from the database into the map.
(WebKit::IconDatabase::pruneTimerFired): Fix typo FaviconDatabse typo
in logging statement.
(WebKit::IconDatabase::iconIDForIconURL): Ditto.
(WebKit::IconDatabase::setIconIDForPageURL):
(WebKit::IconDatabase::iconData):
(WebKit::IconDatabase::addIcon):
(WebKit::IconDatabase::updateIconTimestamp):
(WebKit::IconDatabase::deleteIcon):
(WebKit::IconDatabase::checkIconURLAndSetPageURLIfNeeded): Accomodate
to handle multiple URLs in the pageURL->iconURLs map.
(WebKit::IconDatabase::loadIconsForPageURL): Accomodate to load the
data for all the icons associated with the given pageURL.
(WebKit::IconDatabase::iconURLsForPageURL): Accomodate to handle
multiple URLs in the pageURL->iconURLs map.
(WebKit::IconDatabase::setIconForPageURL):
(WebKit::IconDatabase::populatePageURLToIconURLMap): Renamed to
populatePageURLToIconURLsMap.
(WebKit::IconDatabase::loadIconForPageURL): Renamed to
loadIconsForPageURL.
(WebKit::IconDatabase::iconURLForPageURL): Renamed to
iconURLsForPageURL.
* Source/WebKit/UIProcess/API/glib/IconDatabase.h: Use a ListHashSet
to store the pageURL->iconURLs map.
* Source/WebKit/UIProcess/API/glib/WebKitFaviconDatabase.cpp:
(webkitFaviconDatabaseGetFaviconInternal): Now that the IconDatabase
returns multiple icons for a page URL, pick and return only the last
one, to preserve existing behaviour.
(webkit_favicon_database_get_favicon_uri): Ditto.
Canonical link: https://commits.webkit.org/302307@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications