summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/loader/DocumentLoader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/loader/DocumentLoader.cpp')
-rw-r--r--Source/WebCore/loader/DocumentLoader.cpp40
1 files changed, 39 insertions, 1 deletions
diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp
index e223765..121045b 100644
--- a/Source/WebCore/loader/DocumentLoader.cpp
+++ b/Source/WebCore/loader/DocumentLoader.cpp
@@ -112,6 +112,10 @@ FrameLoader* DocumentLoader::frameLoader() const
DocumentLoader::~DocumentLoader()
{
ASSERT(!m_frame || frameLoader()->activeDocumentLoader() != this || !frameLoader()->isLoading());
+ if (m_iconLoadDecisionCallback)
+ m_iconLoadDecisionCallback->invalidate();
+ if (m_iconDataCallback)
+ m_iconDataCallback->invalidate();
}
PassRefPtr<SharedBuffer> DocumentLoader::mainResourceData() const
@@ -836,7 +840,41 @@ void DocumentLoader::transferLoadingResourcesFromPage(Page* oldPage)
void DocumentLoader::iconLoadDecisionAvailable()
{
if (m_frame)
- m_frame->loader()->iconLoadDecisionAvailable();
+ m_frame->loader()->iconLoadDecisionReceived(iconDatabase().synchronousLoadDecisionForIconURL(KURL(frameLoader()->iconURL()), this));
}
+static void iconLoadDecisionCallback(IconLoadDecision decision, void* context)
+{
+ static_cast<DocumentLoader*>(context)->continueIconLoadWithDecision(decision);
+}
+
+void DocumentLoader::getIconLoadDecisionForIconURL(const String& urlString)
+{
+ if (m_iconLoadDecisionCallback)
+ m_iconLoadDecisionCallback->invalidate();
+ m_iconLoadDecisionCallback = IconLoadDecisionCallback::create(this, iconLoadDecisionCallback);
+ iconDatabase().loadDecisionForIconURL(urlString, m_iconLoadDecisionCallback);
+}
+
+void DocumentLoader::continueIconLoadWithDecision(IconLoadDecision decision)
+{
+ ASSERT(m_iconLoadDecisionCallback);
+ m_iconLoadDecisionCallback = 0;
+ if (m_frame)
+ m_frame->loader()->continueIconLoadWithDecision(decision);
+}
+
+static void iconDataCallback(SharedBuffer*, void*)
+{
+ // FIXME: Implement this once we know what parts of WebCore actually need the icon data returned.
}
+
+void DocumentLoader::getIconDataForIconURL(const String& urlString)
+{
+ if (m_iconDataCallback)
+ m_iconDataCallback->invalidate();
+ m_iconDataCallback = IconDataCallback::create(this, iconDataCallback);
+ iconDatabase().iconDataForIconURL(urlString, m_iconDataCallback);
+}
+
+} // namespace WebCore