summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/loader/DocumentLoader.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-25 19:08:45 +0100
committerSteve Block <steveblock@google.com>2011-06-08 13:51:31 +0100
commit2bde8e466a4451c7319e3a072d118917957d6554 (patch)
tree28f4a1b869a513e565c7760d0e6a06e7cf1fe95a /Source/WebCore/loader/DocumentLoader.cpp
parent6939c99b71d9372d14a0c74a772108052e8c48c8 (diff)
downloadexternal_webkit-2bde8e466a4451c7319e3a072d118917957d6554.zip
external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.gz
external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.bz2
Merge WebKit at r82507: Initial merge by git
Change-Id: I60ce9d780725b58b45e54165733a8ffee23b683e
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