From 5466563f4b5b6b86523e3f89bb7f77e5b5270c78 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 15 Oct 2012 16:08:57 +0200 Subject: Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 (http://svn.webkit.org/repository/webkit/trunk@131300) WebKit update which introduces the QtWebKitWidgets module that contains the WK1 widgets based API. (In fact it renames QtWebKit to QtWebKitWidgets while we're working on completing the entire split as part of https://bugs.webkit.org/show_bug.cgi?id=99314 --- Source/WebKit2/UIProcess/WebIconDatabase.cpp | 30 +++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'Source/WebKit2/UIProcess/WebIconDatabase.cpp') diff --git a/Source/WebKit2/UIProcess/WebIconDatabase.cpp b/Source/WebKit2/UIProcess/WebIconDatabase.cpp index 41c2617bf..8b71e89e0 100644 --- a/Source/WebKit2/UIProcess/WebIconDatabase.cpp +++ b/Source/WebKit2/UIProcess/WebIconDatabase.cpp @@ -54,6 +54,7 @@ WebIconDatabase::WebIconDatabase(WebContext* context) , m_urlImportCompleted(false) , m_databaseCleanupDisabled(false) { + m_webContext->addMessageReceiver(CoreIPC::MessageClassWebIconDatabase, this); } void WebIconDatabase::invalidate() @@ -180,6 +181,11 @@ void WebIconDatabase::getLoadDecisionForIconURL(const String& iconURL, uint64_t m_webContext->sendToAllProcesses(Messages::WebIconDatabaseProxy::ReceivedIconLoadDecision((int)decision, callbackID)); } +void WebIconDatabase::didReceiveIconForPageURL(const String& pageURL) +{ + notifyIconDataReadyForPageURL(pageURL); +} + Image* WebIconDatabase::imageForPageURL(const String& pageURL, const WebCore::IntSize& iconSize) { if (!m_webContext || !m_iconDatabaseImpl || !m_iconDatabaseImpl->isOpen() || pageURL.isEmpty()) @@ -203,6 +209,11 @@ bool WebIconDatabase::isOpen() return m_iconDatabaseImpl && m_iconDatabaseImpl->isOpen(); } +bool WebIconDatabase::isUrlImportCompleted() +{ + return m_urlImportCompleted; +} + void WebIconDatabase::removeAllIcons() { m_iconDatabaseImpl->removeAllIcons(); @@ -224,11 +235,6 @@ void WebIconDatabase::initializeIconDatabaseClient(const WKIconDatabaseClient* c } // WebCore::IconDatabaseClient -bool WebIconDatabase::performImport() -{ - // WebKit2 icon database doesn't currently support importing any old icon database formats. - return true; -} void WebIconDatabase::didImportIconURLForPageURL(const String& pageURL) { @@ -237,7 +243,7 @@ void WebIconDatabase::didImportIconURLForPageURL(const String& pageURL) void WebIconDatabase::didImportIconDataForPageURL(const String& pageURL) { - didChangeIconForPageURL(pageURL); + notifyIconDataReadyForPageURL(pageURL); } void WebIconDatabase::didChangeIconForPageURL(const String& pageURL) @@ -263,14 +269,14 @@ void WebIconDatabase::didFinishURLImport() HashMap::iterator end = m_pendingLoadDecisionURLMap.end(); for (; i != end; ++i) { - LOG(IconDatabase, "WK2 UIProcess performing delayed callback on callback ID %i for page url %s", (int)i->first, i->second.ascii().data()); - IconLoadDecision decision = m_iconDatabaseImpl->synchronousLoadDecisionForIconURL(i->second, 0); + LOG(IconDatabase, "WK2 UIProcess performing delayed callback on callback ID %i for page url %s", (int)i->key, i->value.ascii().data()); + IconLoadDecision decision = m_iconDatabaseImpl->synchronousLoadDecisionForIconURL(i->value, 0); // Decisions should never be unknown after the inital import is complete ASSERT(decision != IconLoadUnknown); // FIXME (Multi-WebProcess): We need to know which connection to send this message to. - m_webContext->sendToAllProcesses(Messages::WebIconDatabaseProxy::ReceivedIconLoadDecision(static_cast(decision), i->first)); + m_webContext->sendToAllProcesses(Messages::WebIconDatabaseProxy::ReceivedIconLoadDecision(static_cast(decision), i->key)); } m_pendingLoadDecisionURLMap.clear(); @@ -288,4 +294,10 @@ void WebIconDatabase::didReceiveSyncMessage(CoreIPC::Connection* connection, Cor didReceiveSyncWebIconDatabaseMessage(connection, messageID, decoder, reply); } +void WebIconDatabase::notifyIconDataReadyForPageURL(const String& pageURL) +{ + m_iconDatabaseClient.iconDataReadyForPageURL(this, WebURL::create(pageURL).get()); + didChangeIconForPageURL(pageURL); +} + } // namespace WebKit -- cgit v1.2.1