summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/WebIconDatabase.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-17 16:21:14 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-17 16:21:14 +0200
commit8995b83bcbfbb68245f779b64e5517627c6cc6ea (patch)
tree17985605dab9263cc2444bd4d45f189e142cca7c /Source/WebKit2/UIProcess/WebIconDatabase.cpp
parentb9c9652036d5e9f1e29c574f40bc73a35c81ace6 (diff)
downloadqtwebkit-8995b83bcbfbb68245f779b64e5517627c6cc6ea.tar.gz
Imported WebKit commit cf4f8fc6f19b0629f51860cb2d4b25e139d07e00 (http://svn.webkit.org/repository/webkit/trunk@131592)
New snapshot that includes the build fixes for Mac OS X 10.6 and earlier as well as the previously cherry-picked changes
Diffstat (limited to 'Source/WebKit2/UIProcess/WebIconDatabase.cpp')
-rw-r--r--Source/WebKit2/UIProcess/WebIconDatabase.cpp30
1 files changed, 21 insertions, 9 deletions
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<uint64_t, String>::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): <rdar://problem/12240223> We need to know which connection to send this message to.
- m_webContext->sendToAllProcesses(Messages::WebIconDatabaseProxy::ReceivedIconLoadDecision(static_cast<int>(decision), i->first));
+ m_webContext->sendToAllProcesses(Messages::WebIconDatabaseProxy::ReceivedIconLoadDecision(static_cast<int>(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