-
rdar://problem/8648311https://bugs.webkit.org/show_bug.cgi?id=56876beidson@apple.com authored
WK2 Icon DB: Expand IconDatabaseClient interface and move it to the main thread Reviewed by Sam Weinig. ../WebCore: * loader/icon/IconDatabase.cpp: Add a dummy client implementation for non-Mac, non-Win ports: (WebCore::DefaultIconDatabaseClient::performImport): (WebCore::DefaultIconDatabaseClient::didImportIconURLForPageURL): (WebCore::DefaultIconDatabaseClient::didImportIconDataForPageURL): (WebCore::DefaultIconDatabaseClient::didChangeIconForPageURL): (WebCore::DefaultIconDatabaseClient::didRemoveAllIcons): (WebCore::DefaultIconDatabaseClient::didFinishURLImport): (WebCore::defaultClient): Either call the client directly when on the main thread, or use the dispatch functions below if on the background thread: (WebCore::IconDatabase::setIconDataForIconURL): (WebCore::IconDatabase::setIconURLForPageURL): (WebCore::IconDatabase::performURLImport): (WebCore::IconDatabase::readFromDatabase): (WebCore::IconDatabase::removeAllIconsOnThread): Add a very targeted WorkItem interface for dispatching client calls on the main thread: (WebCore::ClientWorkItem::ClientWorkItem): (WebCore::ClientWorkItem::~ClientWorkItem): (WebCore::ImportedIconURLForPageURLWorkItem::ImportedIconURLForPageURLWorkItem): (WebCore::ImportedIconURLForPageURLWorkItem::~ImportedIconURLForPageURLWorkItem): (WebCore::ImportedIconURLForPageURLWorkItem::performWork): (WebCore::ImportedIconDataForPageURLWorkItem::ImportedIconDataForPageURLWorkItem): (WebCore::ImportedIconDataForPageURLWorkItem::~ImportedIconDataForPageURLWorkItem): (WebCore::ImportedIconDataForPageURLWorkItem::performWork): (WebCore::RemovedAllIconsWorkItem::RemovedAllIconsWorkItem): (WebCore::RemovedAllIconsWorkItem::performWork): (WebCore::performWorkItem): Use the client WorkItem interface to perform these callbacks on the main thread: (WebCore::IconDatabase::dispatchDidImportIconURLForPageURLOnMainThread): (WebCore::IconDatabase::dispatchDidImportIconDataForPageURLOnMainThread): (WebCore::IconDatabase::dispatchDidRemoveAllIconsOnMainThread): * loader/icon/IconDatabase.h: * loader/icon/IconDatabaseClient.h: ../WebKit/mac: Note that while the new client calls always come through on the main thread, our mechanisms to route dispatches to the main thread are still valid and will still work. Update to the new IconDatabaseClient interface: * WebCoreSupport/WebIconDatabaseClient.h: * WebCoreSupport/WebIconDatabaseClient.mm: (WebIconDatabaseClient::didRemoveAllIcons): (WebIconDatabaseClient::didImportIconURLForPageURL): (WebIconDatabaseClient::didImportIconDataForPageURL): (WebIconDatabaseClient::didChangeIconForPageURL): (WebIconDatabaseClient::didFinishURLImport): ../WebKit/win: Note that while the new client calls always come through on the main thread, our mechanisms to route dispatches to the main thread are still valid and will still work. Update to the new IconDatabaseClient interface: * WebIconDatabase.cpp: (WebIconDatabase::performImport): (WebIconDatabase::didRemoveAllIcons): (WebIconDatabase::didImportIconURLForPageURL): (WebIconDatabase::didImportIconDataForPageURL): (WebIconDatabase::didChangeIconForPageURL): (WebIconDatabase::didFinishURLImport): * WebIconDatabase.h: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81719 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ccb0e20f