Changeset 220694 in webkit
- Timestamp:
- Aug 14, 2017 8:44:02 AM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r220677 r220694 1 2017-08-14 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK][WPE] Avoid emitting WebKitFaviconDatabase::favicon-changed multiple times while setting an icon 4 https://bugs.webkit.org/show_bug.cgi?id=175531 5 6 Reviewed by Michael Catanzaro. 7 8 When webkitFaviconDatabaseSetIconForPageURL() is called, both setIconURLForPageURL() and setIconDataForIconURL() 9 might notify the client, which ends up emitting the WebKitFaviconDatabase::favicon-changed signal and calling 10 webkitFaviconDatabaseSetIconURLForPageURL(). Both things are already done by 11 webkitFaviconDatabaseSetIconForPageURL() itself, so we can just ignore the client notification while setting a 12 new icon. 13 14 * UIProcess/API/glib/WebKitFaviconDatabase.cpp: 15 (webkitFaviconDatabaseSetIconURLForPageURL): Return early if isSettingIcon is true. 16 (webkitFaviconDatabaseSetIconForPageURL): Set isSettingIcon to true for the scope. 17 1 18 2017-08-14 Carlos Garcia Campos <cgarcia@igalia.com> 2 19 -
trunk/Source/WebKit/UIProcess/API/glib/WebKitFaviconDatabase.cpp
r220580 r220694 30 30 #include <glib/gi18n-lib.h> 31 31 #include <wtf/RunLoop.h> 32 #include <wtf/SetForScope.h> 32 33 #include <wtf/glib/GRefPtr.h> 33 34 #include <wtf/glib/GUniquePtr.h> … … 76 77 HashMap<String, String> pageURLToIconURLMap; 77 78 bool isURLImportCompleted; 79 bool isSettingIcon; 78 80 }; 79 81 … … 194 196 195 197 priv->pageURLToIconURLMap.set(pageURL, iconURL); 198 if (priv->isSettingIcon) 199 return; 200 196 201 g_signal_emit(database, signals[FAVICON_CHANGED], 0, pageURL.utf8().data(), iconURL.utf8().data()); 197 202 } … … 213 218 void didChangeIconForPageURL(const String& pageURL) override 214 219 { 220 if (m_database->priv->isSettingIcon) 221 return; 215 222 String iconURL = m_database->priv->iconDatabase->synchronousIconURLForPageURL(pageURL); 216 223 webkitFaviconDatabaseSetIconURLForPageURL(m_database, iconURL, pageURL); … … 306 313 307 314 WebKitFaviconDatabasePrivate* priv = database->priv; 315 SetForScope<bool> change(priv->isSettingIcon, true); 308 316 priv->iconDatabase->setIconURLForPageURL(icon.url.string(), pageURL); 309 317 priv->iconDatabase->setIconDataForIconURL(SharedBuffer::create(iconData.bytes(), iconData.size()), icon.url.string());
Note: See TracChangeset
for help on using the changeset viewer.